CTZ of any number

by Ricardo Fernández Serrata

Version 1 (November 26, 2021)

Download (0 downloads)

Count Trailing binary Zeros faster than trial division by 2.

This has such a high performance because of binary floating-point "hacks".

1023 is the maximum exponent of a IEEE 754 64bit floating point number, so adding 1 gives the max number of zeros (0x3ff + 1 = 0x400)