bitLRotate | Multi Theft Auto: Wiki Skip to content

bitLRotate

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This functions performs a bitwise circular left-rotation on the integer value by integer n positions. See Bitwise operation for more details.

Syntax

bitLRotate ( )

Code Examples

server

This example shows the usage of the functionbitLRotate.

local value = 0xF -- binary: 1111, decimal: 15
local positions = 0x1 -- binary: 0001, decimal: 1
local shifted = bitLRotate( value, positions ) -- binary: 0001 1110, decimal: 30
local value = 0xF -- binary: 1111, decimal: 15
local positions = 0x3 -- binary: 0011, decimal: 3
local shifted = bitLRotate( value, positions ) -- binary: 0111 1000, decimal: 120
local value = 0x3F -- binary: 0011 1111, decimal: 63
local positions = 0xA -- binary: 1010, decimal: 10
local shifted = bitLRotate( value, positions ) -- binary: 1111 1100 0000 0000, decimal: 64.512