A collection of low-level, static Int manipulation helper functions.
Static methods
staticbitLen(x:Int):Int
Calculates the bit length of a signed 32-bit integer.
Parameters:
x | The integer value. |
---|
Returns:
The number of bits required to represent x
.
staticclp2(x:Int32):Int
"Ceiling power of two" -- round up to the least power of two
greater than or equal to input x
, which is interpreted as
unsigned.
staticnlz(x:Int):Int
"Numbler of leading zeros" - return the number of leading
0-value bits in the binary representation of x
.
Parameters:
x | The integer to inspect. |
---|
Returns:
The count of leading zeros.
staticu32divu16(dividend:Int32, divisor:Int32):Int
Integer division of unsigned 32-bit integer by unsigned 16-bit integer.
Result is undefined when divisor
<= 0 or divisor
>= 2^16.