Bit operationsReference
bit.arshift
Shift right while preserving the sign bit of the 32-bit input.
Details#
Shift right while preserving the sign bit of the 32-bit input. A number in 0…4294967295 representing an unsigned 32-bit result.
Signature#
bit.arshift(value: number, count: number): numberParameters#
| Parameter | Type | Description |
|---|---|---|
value | number | Number converted to 32 bits. |
count | number | Count converted to uint32 and masked with 31, so 32 means 0. |
Returns#
A number in 0…4294967295 representing an unsigned 32-bit result.
Examples#
Local example
print(bit.arshift(0x80000000, 1)) -- 3221225472