BitTest2 ( value ; bit )
Checks whether bit 'bit' in value 'value' is on or off
Average rating: 4.2 (34 votes) Log in to vote
Stephen Drake - Show more from this author
Synergy n/a |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
A non-recursive alternative to BitTest.
Bits are numbered from zero.
Div ( value ; 2 ^ bit ) is odd if the tested bit is set,
lower bits that are set add zero to the result,
higher bits that are set add an even number to the result.
If required, you could add error checking to make sure bit and value are >= 0.
Alternatively, you can use the function as is to test bits in the fractional part of the value or to test negative values.
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.