Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Math.BitwiseAND

Perform bitwise AND operation.

Component Version macOS Windows Linux Server iOS SDK
Math 4.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Math.BitwiseAND"; value1; value2... )   More

Parameters

Parameter Description Example
value1 The first number. 5
value2... The second number. 6

Result

Returns number.

Description

Perform bitwise AND operation.
Only for integer numbers. You can pass several values to combine more than 2 values.

Updated to use 64-bit signed integers in version 7.3.

This function takes variable number of parameters. Pass as much parameters as needed separated by the semicolon in FileMaker.
Please repeat value2 parameter as often as you need.

Examples

Applies bitwise and for three numbers which gives 16:

MBS("Math.BitwiseAND"; 255; 48; 18)

Split MIDI Timestamp:

# last five bits are frame counter
Set Variable [$Frame; MBS("Math.BitwiseAND"; TimeStamp; 31)]
# Seconds are in 2nd byte, so take 6 bits after shifting 8 to right
Set Variable [$Second; MBS( "Math.BitwiseAND"; MBS( "Math.BitwiseShiftRight"; TimeStamp; 8 ); 63)
# Minutes are in 3rd byte, so take 6 bits after shifting 16 to right
Set Variable [$Minute; MBS( "Math.BitwiseAND"; MBS( "Math.BitwiseShiftRight"; TimeStamp; 16 ); 63)
# Hours are in 4th byte: take 5 bits after shifting 24 to right
Set Variable [$Hour; MBS( "Math.BitwiseAND"; MBS( "Math.BitwiseShiftRight"; TimeStamp; 24 ); 31)

See also

Release notes

Example Databases

Blog Entries

This function is free to use.

Created 18th August 2014, last changed 20th February 2023


Math.Average - Math.BitwiseNOT