Message408992
Yes, confirmed that this is not a bug, but just one of the many consequences of approximating real numbers by floating-point numbers.
You may be interested in math.log2 and/or int.bit_length. math.log2(x) *may* give you more accurate results than math.log(x, 2) when x is a power of two, but there are no guarantees - we're at the mercy of the C math library here. |
|
Date |
User |
Action |
Args |
2021-12-21 08:54:04 | mark.dickinson | set | recipients:
+ mark.dickinson, joshinsel |
2021-12-21 08:54:04 | mark.dickinson | set | messageid: <1640076844.55.0.733119353282.issue46144@roundup.psfhosted.org> |
2021-12-21 08:54:04 | mark.dickinson | link | issue46144 messages |
2021-12-21 08:54:04 | mark.dickinson | create | |
|