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 cykerway
Recipients cykerway, mark.dickinson, steven.daprano
Date 2021-12-24.23:40:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1640389221.41.0.938480898517.issue46173@roundup.psfhosted.org>
In-reply-to
Content
Alright that helps. I guess I now understand what's happening here. Here are the two numbers in question:

>>> M = int('1'*53+'0'*971, 2)
>>> N = int('1'*53+'0'+'1'*970, 2)

M is the largest number in binary64 range, while N is the largest number that does not emit an OverflowError when converted to binary64. N+1 will emit that error. N-M == 2**970-1 which means N is larger than M that caused the confusion.
History
Date User Action Args
2021-12-24 23:40:21cykerwaysetrecipients: + cykerway, mark.dickinson, steven.daprano
2021-12-24 23:40:21cykerwaysetmessageid: <1640389221.41.0.938480898517.issue46173@roundup.psfhosted.org>
2021-12-24 23:40:21cykerwaylinkissue46173 messages
2021-12-24 23:40:21cykerwaycreate