Base-two logarithm of 8-bit unsigned integers. Returns ⌊max 0 (log₂ a)⌋.
This function is overridden at runtime with an efficient implementation. This definition is the logical model.
Examples:
- UInt8.log2 0 = 0
- UInt8.log2 1 = 0
- UInt8.log2 2 = 1
- UInt8.log2 4 = 2
- UInt8.log2 7 = 2
- UInt8.log2 8 = 3
Instances For
Base-two logarithm of 16-bit unsigned integers. Returns ⌊max 0 (log₂ a)⌋.
This function is overridden at runtime with an efficient implementation. This definition is the logical model.
Examples:
- UInt16.log2 0 = 0
- UInt16.log2 1 = 0
- UInt16.log2 2 = 1
- UInt16.log2 4 = 2
- UInt16.log2 7 = 2
- UInt16.log2 8 = 3
Instances For
Base-two logarithm of 32-bit unsigned integers. Returns ⌊max 0 (log₂ a)⌋.
This function is overridden at runtime with an efficient implementation. This definition is the logical model.
Examples:
- UInt32.log2 0 = 0
- UInt32.log2 1 = 0
- UInt32.log2 2 = 1
- UInt32.log2 4 = 2
- UInt32.log2 7 = 2
- UInt32.log2 8 = 3
Instances For
Base-two logarithm of 64-bit unsigned integers. Returns ⌊max 0 (log₂ a)⌋.
This function is overridden at runtime with an efficient implementation. This definition is the logical model.
Examples:
- UInt64.log2 0 = 0
- UInt64.log2 1 = 0
- UInt64.log2 2 = 1
- UInt64.log2 4 = 2
- UInt64.log2 7 = 2
- UInt64.log2 8 = 3
Instances For
Base-two logarithm of word-sized unsigned integers. Returns ⌊max 0 (log₂ a)⌋.
This function is overridden at runtime with an efficient implementation. This definition is the logical model.
Examples:
- USize.log2 0 = 0
- USize.log2 1 = 0
- USize.log2 2 = 1
- USize.log2 4 = 2
- USize.log2 7 = 2
- USize.log2 8 = 3