Difference between revisions of "Bit32"
Line 19: | Line 19: | ||
[[bit32.countrz]] ''returns the number of consecutive zero bits in the 32-bit representation of the provided number starting from the right-most (least significant) bit''<br/><!--GIDEROSMTD:bit32.countrz(n: number): number, returns the number of consecutive zero bits in the 32-bit representation of the provided number starting from the right-most (least significant) bit--> | [[bit32.countrz]] ''returns the number of consecutive zero bits in the 32-bit representation of the provided number starting from the right-most (least significant) bit''<br/><!--GIDEROSMTD:bit32.countrz(n: number): number, returns the number of consecutive zero bits in the 32-bit representation of the provided number starting from the right-most (least significant) bit--> | ||
[[bit32.extract]] ''extracts a range of bits from a number and return them as an unsigned number''<br/><!--GIDEROSMTD:bit32.extract(n: number, field: number, width: number): number, extracts a range of bits from a number and return them as an unsigned number--> | [[bit32.extract]] ''extracts a range of bits from a number and return them as an unsigned number''<br/><!--GIDEROSMTD:bit32.extract(n: number, field: number, width: number): number, extracts a range of bits from a number and return them as an unsigned number--> | ||
− | |||
[[bit32.lrotate]] ''returns a number after its bits have been rotated to the left by a given number of times''<br/><!--GIDEROSMTD:bit32.lrotate(x: number, disp: number): number, returns a number after its bits have been rotated to the left by a given number of times--> | [[bit32.lrotate]] ''returns a number after its bits have been rotated to the left by a given number of times''<br/><!--GIDEROSMTD:bit32.lrotate(x: number, disp: number): number, returns a number after its bits have been rotated to the left by a given number of times--> | ||
[[bit32.lshift]] ''returns a number whose bits have been logically shifted to the left by a given displacement''<br/><!--GIDEROSMTD:bit32.lshift(x: number, disp: number): number, returns a number whose bits have been logically shifted to the left by a given displacement--> | [[bit32.lshift]] ''returns a number whose bits have been logically shifted to the left by a given displacement''<br/><!--GIDEROSMTD:bit32.lshift(x: number, disp: number): number, returns a number whose bits have been logically shifted to the left by a given displacement--> | ||
+ | [[bit32.replace]] ''returns a copy of a number with a range of bits replaced by a given value''<br/><!--GIDEROSMTD:bit32.replace(n: number, v: number, field: number, width: number): number, returns a copy of a number with a range of bits replaced by a given value--> | ||
[[bit32.rrotate]] ''returns a number after its bits have been rotated to the right by a given number of times''<br/><!--GIDEROSMTD:bit32.rrotate(x: number, disp: number): number, returns a number after its bits have been rotated to the right by a given number of times--> | [[bit32.rrotate]] ''returns a number after its bits have been rotated to the right by a given number of times''<br/><!--GIDEROSMTD:bit32.rrotate(x: number, disp: number): number, returns a number after its bits have been rotated to the right by a given number of times--> | ||
[[bit32.rshift]] ''returns a number whose bits have been logically shifted to the right by a given displacement''<br/><!--GIDEROSMTD:bit32.rshift(x: number, disp: number): number, returns a number whose bits have been logically shifted to the right by a given displacement--> | [[bit32.rshift]] ''returns a number whose bits have been logically shifted to the right by a given displacement''<br/><!--GIDEROSMTD:bit32.rshift(x: number, disp: number): number, returns a number whose bits have been logically shifted to the right by a given displacement--> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
+ | |||
=== Events === | === Events === | ||
=== Constants === | === Constants === |
Latest revision as of 19:46, 22 January 2023
Supported platforms:
Available since: Gideros 2022.3
Description
This library is a back-ported feature from Lua 5.2 that provides functions to perform bitwise operations.
Methodsbit32.arshift returns a number after its bits have been arithmetically shifted to the right by a given displacement |
EventsConstants |