Steven D'Aprano <steve+pyt...@pearwood.info> added the comment: 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. ---------- nosy: +steven.daprano, tim.peters stage: -> needs patch _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32783> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com