Lasso Soft Inc. > Home

[ Integer->BitFlip ]

Method

[Integer->BitFlip] flips the bit specified in the integer parameter. The bit index should be between 1 and 64.

Returns the result leaving the left side unmodified.

  • Syntax
Integer Variable->BitFlip(Bit Index)
Examples
  • Beginner

To flip a bit within an integer value:

Use the [Integer->BitFlip] method. The following example shows the integer 7 (0111) having its 2nd bit flipped leaving 5 (0101).

Code

local(result = 7)
#result->BitFlip(2)

Result

5

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft