clz

Count leading zeroes.

  1. U clz(U u)
    version(DigitalMars)
    pragma(inline, true) @safe @nogc pure nothrow
    U
    clz
    (
    U
    )
    (
    U u
    )
    if (
    is(Unqual!U == uint) ||
    is(Unqual!U == size_t)
    )
  2. uint clz(U u)
  3. alias clz = __builtin_clz
  4. uint clz(ulong u)
  5. alias clz = __builtin_clzl
  6. U clz(U u)
  7. uint clz(U u)

Parameters

u U

the unsigned value to scan

Return Value

Type: U

The number of leading zero bits before the first one bit. If u is 0, the result is undefined.

Meta