$BitAnd: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />Bitwise AND of two integers<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />Bitwise AND of two integers<section end="desc" /></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 | <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> | ||
The $BitAnd function returns an integer which is the bitwise AND of two integers. | The $BitAnd function returns an integer which is the bitwise AND of two integers. | ||
Line 9: | Line 9: | ||
The first and second arguments are both integers. The default values are 0. | 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"><section begin="syntax" /> %RESULT = $BitAnd(int_1, int_2) | ||
Line 16: | Line 17: | ||
<p class="caption">%RESULT is set to the bitwise AND of the two arguments.</p> | <p class="caption">%RESULT is set to the bitwise AND of the two arguments.</p> | ||
The following program will print the value 2: | |||
<p class="code"> B | <p class="code"> B | ||
PRINT $BitAnd(-2, 3) | PRINT $BitAnd(-2, 3) | ||
Line 36: | Line 37: | ||
<p class="caption">Products authorizing $BitAnd | <p class="caption">Products authorizing $BitAnd | ||
</p> | </p> | ||
[[Category:$Functions|$BitAnd]] | [[Category:$Functions|$BitAnd]] |
Revision as of 16:44, 31 January 2011
<section begin="desc" />Bitwise AND of two integers<section end="desc" />
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).
The $BitAnd function returns an integer which is the bitwise AND of two integers.
$BitAnd accepts two arguments and returns a numeric value.
The first and second arguments are both integers. The default values are 0.
Syntax
<section begin="syntax" /> %RESULT = $BitAnd(int_1, int_2) <section end="syntax" />
The following program will print the value 2:
B PRINT $BitAnd(-2, 3) END