$BitAnd: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (minor word change)
 
(34 intermediate revisions by 4 users not shown)
Line 2: Line 2:
<span class="pageSubtitle">Bitwise AND of two integers</span>
<span class="pageSubtitle">Bitwise AND of two integers</span>


<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $BitAnd function is the [[BitAndInteger (Float function)]]. There is also OO method for strings called [[BitAndString (String function)]].</p>
<p class="warn"><b>Note:</b> Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the <var>$BitAnd</var> function is the <var>[[BitAndInteger (Float function)|BitAndInteger]]</var> function. There is also an OO method for strings called <var>[[BitAndString (String function)|BitAndString]]</var>.</p>


The <var>$BitAnd</var> function returns an integer which is the bitwise AND of two integers.  
The <var>$BitAnd</var> function returns an integer which is the bitwise AND of two integers.  
<var>$BitAnd</var> accepts two arguments and returns a numeric value.
The first and second arguments are both integers. The default values are 0.


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" />%RESULT = $BitAnd(int_1, int_2)
<p class="syntax"><span class="term">%result</span> = <span class="literal">$BitAnd</span>(<span class="term">int_1</span>, <span class="term">int_2</span>)
<section end="syntax" /></p>
<p class="caption">$BitAnd Function
</p>
</p>
<p class="caption">%RESULT is set to the bitwise AND of the two arguments.</p>
<p>
<var class="term">%result</var> is set to the bitwise AND of the two <var>$BitAnd</var> arguments.</p>
<p>
The first and second arguments are both integers, and their default values are 0. An invalid value specified for an argument is treated as a 0.</p>


==Example==
The following program will print the value 2:
The following program will print the value 2:


<p class="code"> B
<p class="code">B
PRINT $BitAnd(-2, 3)
Print $BitAnd(-2, 3)
END
End
</p>
</p>


==Products authorizing {{PAGENAMEE}}==
<ul class="smallAndTightList">
<ul class="smallAndTightList">
<li>[[Sirius functions]]</li>
<li>[[List of $functions|Sirius functions]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Fast/Unload User Language Interface]]</li>
<li>[[Janus Open Client]]</li>
<li>[[Media:JoclrNew.pdf|Janus Open Client]]</li>
<li>[[Janus Open Server]]</li>
<li>[[Media:JosrvrNew.pdf|Janus Open Server]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Sockets]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Janus Web Server]]</li>
<li>[[Japanese functions]]</li>
<li>Japanese functions</li>
<li>[[Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
 
</ul>
</ul>
<p class="caption">Products authorizing $BitAnd
</p>


[[Category:$Functions|$BitAnd]]
[[Category:$Functions|$BitAnd]]

Latest revision as of 15:53, 10 January 2018

Bitwise AND of two integers

Note: Many $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $BitAnd function is the BitAndInteger function. There is also an OO method for strings called BitAndString.

The $BitAnd function returns an integer which is the bitwise AND of two integers.

Syntax

%result = $BitAnd(int_1, int_2)

%result is set to the bitwise AND of the two $BitAnd arguments.

The first and second arguments are both integers, and their default values are 0. An invalid value specified for an argument is treated as a 0.

Example

The following program will print the value 2:

B Print $BitAnd(-2, 3) End

Products authorizing $BitAnd