Skip to content

Log2 rounding error fix

Latest
Compare
Choose a tag to compare
@hornc hornc released this 30 Jul 05:03
d377a5c

Fixes bug #7 where the program value was wrapping incorrectly (corrupting the program) for large program values.

The cause was rounding errors in math.log() which are now avoided by using a custom abct.math function flog2() which calculates the floor of log2 by taking the bit_length() of an integer minus 1, which sidesteps any need for rounding.