$BitAnd: Difference between revisions
Jump to navigation
Jump to search
(Automatically generated page update) |
m (minor word change) |
||
(One intermediate revision by one other user 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="warn"><b>Note: </b> | <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. | ||
Line 9: | Line 9: | ||
<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>) | <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>) | ||
</p> | </p> | ||
<p> | <p> | ||
<var class="term">%result</var> is set to the bitwise AND of the two arguments.</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 | 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== | ==Example== | ||
Line 33: | Line 32: | ||
<li>Japanese functions</li> | <li>Japanese functions</li> | ||
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | <li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li> | ||
</ul> | </ul> | ||
[[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