Message311755
Thanks for the link to the Stackoverflow discussion. Currently there are three answers: two (correctly) answer that the constant as given is the most accurate value for IEEE-754 floats.
Tim Peters has answered that: https://stackoverflow.com/a/48653387
"Either way, the code ensures the best 53-bit approximation to log(2) will be used."
so there is no other value that ln2 can be given that is more accurate given the limitation of 53-bits.
https://stackoverflow.com/a/48653387
The difference between the given value and the mathematically precise value is not a bug but intentional. I'm not closing this ticket as I think that this should be documented in the source, to prevent future confusion. |
|
Date |
User |
Action |
Args |
2018-02-07 00:14:57 | steven.daprano | set | recipients:
+ steven.daprano, tim.peters, mark.dickinson, christian.heimes, matanya.stroh |
2018-02-07 00:14:57 | steven.daprano | set | messageid: <1517962497.73.0.467229070634.issue32783@psf.upfronthosting.co.za> |
2018-02-07 00:14:57 | steven.daprano | link | issue32783 messages |
2018-02-07 00:14:57 | steven.daprano | create | |
|