Discussion 解説
For example, in an integer type with a bit
value of 8, the number 31 has three leading zeros.
例えば、8のbit
値を持つ整数型において、数31は3つの先頭のゼロを持ちます。
let x: Int8 = 0b0001_1111
// x == 31
// x.leadingZeroBitCount == 3
Availability
Technology
var leadingZeroBitCount: Int
{ get }
For example, in an integer type with a bit
value of 8, the number 31 has three leading zeros.
例えば、8のbit
値を持つ整数型において、数31は3つの先頭のゼロを持ちます。
let x: Int8 = 0b0001_1111
// x == 31
// x.leadingZeroBitCount == 3