bit32.countlz(n: number) : integer|number
Returns the number of consecutive zero bits in the 32-bit representation of n
starting from the left-most (most significant) bit.
Returns 32
if n
is 0
.
bit32.countlz(5)
{
"def": "func",
"name": "countlz",
"energy": 0,
"pure": true,
"sleep": 0,
"signatures": [
{
"result": [
{
"name": "",
"def": "result",
"desc": "",
"variadic": false,
"type": [
"integer"
],
"optional": false
}
],
"args": [
{
"def": "arg",
"name": "n",
"desc": "",
"type": [
"integer"
],
"variadic": false,
"optional": false
}
]
},
{
"result": [
{
"name": "",
"def": "result",
"desc": "",
"variadic": false,
"type": [
"number"
],
"optional": false
}
],
"args": [
{
"def": "arg",
"name": "n",
"desc": "",
"type": [
"integer",
"number"
],
"variadic": false,
"optional": false
}
]
}
],
"desc": "Returns the number of consecutive zero bits in the 32-bit representation of `n` starting from the left-most (most significant) bit.\nReturns `32` if `n` is `0`.",
"link": "https://luau.org/library#bit32-library#:~:text=function%20bit32.countlz"
}