MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / ctlz

Method ctlz

Source/external/fast_float.h:2361–2373  ·  view source on GitHub ↗

get the number of leading zeros in the bigint.

Source from the content-addressed store, hash-verified

2359
2360 // get the number of leading zeros in the bigint.
2361 FASTFLOAT_CONSTEXPR20 int ctlz() const noexcept {
2362 if (vec.is_empty()) {
2363 return 0;
2364 } else {
2365#ifdef FASTFLOAT_64BIT_LIMB
2366 return leading_zeroes(vec.rindex(0));
2367#else
2368 // no use defining a specialized leading_zeroes for a 32-bit type.
2369 uint64_t r0 = vec.rindex(0);
2370 return leading_zeroes(r0 << 32);
2371#endif
2372 }
2373 }
2374
2375 // get the number of bits in the bigint.
2376 FASTFLOAT_CONSTEXPR20 int bit_length() const noexcept {

Callers

nothing calls this directly

Calls 2

leading_zeroesFunction · 0.85
is_emptyMethod · 0.80

Tested by

no test coverage detected