bit32.countlz (n: number) -> 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(3.14)
{
"def": "func",
"name": "countlz",
"energy": 0,
"must_use": true,
"sleep": 0,
"signatures": [
{
"def": "signature",
"result": [
{
"name": "",
"def": "result",
"desc": "",
"variadic": false,
"type": [
{
"def": "simple",
"value": "number"
}
],
"optional": false
}
],
"args": [
{
"def": "arg",
"name": "n",
"desc": "",
"type": [
{
"def": "simple",
"value": "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",
"takesSelf": false,
"private": false
}