This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients christian.heimes, mark.dickinson, matanya.stroh, steven.daprano, tim.peters
Date 2018-02-07.00:14:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517962497.73.0.467229070634.issue32783@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-02-07 00:14:57steven.dapranosetrecipients: + steven.daprano, tim.peters, mark.dickinson, christian.heimes, matanya.stroh
2018-02-07 00:14:57steven.dapranosetmessageid: <1517962497.73.0.467229070634.issue32783@psf.upfronthosting.co.za>
2018-02-07 00:14:57steven.dapranolinkissue32783 messages
2018-02-07 00:14:57steven.dapranocreate