$BitAnd: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (minor word change)
 
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>Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $BitAnd function is the <var>[[BitAndInteger (Float function)|BitAndInteger]]</var> function. There is also OO method for strings called <var>[[BitAndString (String function)|BitAndString]]</var>.</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.  
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>
<p>The first and second arguments are both integers. The default values are 0. If either argument is invalid, it defaults to 0.</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==
==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>
<p>
</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