Bit32.countlz: Difference between revisions
From GiderosMobile
Created page with "__NOTOC__ '''Available since:''' Gideros 2022.3<br/> '''Class:''' bit32<br/> === Description === Returns the number of consecutive zero bits in the 32-bit representation..." |
m Text replacement - "<source" to "<syntaxhighlight" |
||
| Line 5: | Line 5: | ||
=== Description === | === Description === | ||
Returns the number of consecutive zero bits in the 32-bit representation of the provided number starting from the left-most (most significant) bit. Returns 32 if the provided number is zero. | Returns the number of consecutive zero bits in the 32-bit representation of the provided number starting from the left-most (most significant) bit. Returns 32 if the provided number is zero. | ||
< | <syntaxhighlight lang="lua"> | ||
(number) = bit32.countlz(n) | (number) = bit32.countlz(n) | ||
</source> | </source> | ||
Revision as of 13:26, 13 July 2023
Available since: Gideros 2022.3
Class: bit32
Description
Returns the number of consecutive zero bits in the 32-bit representation of the provided number starting from the left-most (most significant) bit. Returns 32 if the provided number is zero. <syntaxhighlight lang="lua"> (number) = bit32.countlz(n) </source>
Parameters
n: (number) value
Return values
Returns (number) result, returns 32 if the provided number is zero
See also