Math.BitwiseRotate
------------------

Rotates the bits in a 64-bit integer number.

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

MBS( "Math.BitwiseRotate"; Value; Bits ) 

**MBS**( **"Math.BitwiseRotate";** /\* Rotates the bits in a 64-bit integer number. \*/  
**$Value**; /\* The value to rotate.e.g. 123 \*/   
**$Bits**) /\* The number of bits to rotate.  
From 0 to 63.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Value | The value to rotate. | 123 |
| Bits | The number of bits to rotate.   From 0 to 63. | 1 |

### Result

Returns number or error.

### Description

Rotates the bits in a 64-bit integer number.  
Version 15.3 only rotates left. With 15.4 can rotate right, too.   
### Examples

Rotate one to left:

 MBS ( "Math.BitwiseRotate"; 123; 1 )  
<small>  
Example result: 246</small>Rotate right:

 MBS ( "Math.BitwiseRotate"; 128; -1 )  
<small>  
Example result: 64</small>### Release notes

- **Version 15.4**
    - Fixed [Math.BitwiseRotate](https://www.mbsplugins.eu/MathBitwiseRotate.shtml) to better rotate to right.
- **Version 15.3**
    - Added [Math.BitwiseRotate](https://www.mbsplugins.eu/MathBitwiseRotate.shtml) function.

### Blog Entries

- [MBS FileMaker Plugin, version 15.4pr1](https://www.mbsplugins.de/archive/2025-08-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 15.3pr1](https://www.mbsplugins.de/archive/2025-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 22nd May 2025 , last changed 17th July 2025

  
[Math.BitwiseOR](MathBitwiseOR.md) - [Math.BitwiseShiftLeft](MathBitwiseShiftLeft.md)

[HTML Version](MathBitwiseRotate.shtml)