Math.BitwiseAND
---------------

Perform bitwise AND operation.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Math](component_Math.md) | [4.1](newinversion41.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "Math.BitwiseAND"; Value1; value2... ) 

**MBS**( **"Math.BitwiseAND";** /\* Perform bitwise AND operation. \*/  
**$Value1**; /\* The first number.e.g. 5 \*/   
**$value2...**) /\* The second number.e.g. 6 \*/ 

### 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](MathBitwiseShiftRight.md)"; 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](MathBitwiseShiftRight.md)"; 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](MathBitwiseShiftRight.md)"; TimeStamp; 24 ); 31) \]  
### See also

- [DynaPDF.GetOCG](DynaPDFGetOCG.md)
- [Math.BitwiseNOT](MathBitwiseNOT.md)
- [Math.BitwiseOR](MathBitwiseOR.md)
- [Math.BitwiseShiftRight](MathBitwiseShiftRight.md)
- [Math.GetBit](MathGetBit.md)
- [PortMidi.ReadMessage](PortMidiReadMessage.md)
- [Preferences.GetValue](PreferencesGetValue.md)
- [SQL.ClientVersion](SQLClientVersion.md)
- [UnZipFile.ItemFlag](UnZipFileItemFlag.md)
- [WMFP.GetVideoFrameRate](WMFPGetVideoFrameRate.md)

### Release notes

- **Version 7.3**
    - Improved [Math.BitwiseAND](http://www.mbsplugins.eu/MathBitwiseAND.shtml), [Math.BitwiseOR](http://www.mbsplugins.eu/MathBitwiseOR.shtml), [Math.BitwiseNOT](http://www.mbsplugins.eu/MathBitwiseNOT.shtml), [Math.BitwiseXOR](http://www.mbsplugins.eu/MathBitwiseXOR.shtml), [Math.BitwiseShiftRight](http://www.mbsplugins.eu/MathBitwiseShiftRight.shtml) and [Math.BitwiseShiftLeft](http://www.mbsplugins.eu/MathBitwiseShiftLeft.shtml) to use 64-bit integers instead of 32-bit.

### Example Databases

- [SmartCard/SmartCard ReadFile](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SmartCard/SmartCard%20ReadFile.shtml#1306FieldAnchor_)
- [SmartCard/SmartCard Signatures](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SmartCard/SmartCard%20Signatures.shtml#1306FieldAnchor_)
- [Win Only/Receive System Notifications](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/Receive%20System%20Notifications.shtml#3ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 7.3pr7](https://www.mbsplugins.de/archive/2017-07-15/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 4.1pr5](https://www.mbsplugins.de/archive/2014-03-14/MBS_Filemaker_Plugin_version_4/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 25th February 2026

  
[Math.Average](MathAverage.md) - [Math.BitwiseNOT](MathBitwiseNOT.md)

[HTML Version](MathBitwiseAND.shtml)