CTZ of any number

by Ricardo Fernández Serrata

Version 3 (May 21, 2022)

Download (20 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 max exponent of an IEEE 754 "binary64" number, so adding 1 gives the max number of zeros (0x3ff + 1 = 0x400)

More info: https://gist.github.com/Rudxain/ad3d70e52c4d392411f9f2184c7003cf

LICENSE: https://unlicense.org

4.0 average rating from 1 reviews

5 stars
0
4 stars
1
3 stars
0
2 stars
0
1 star
0
Reports
0

Rate and review within the app in the Community section.