[Python-ideas] Suggestion: Extend integers to include iNaN

David Mertz mertz at gnosis.cx
Sun Sep 30 10:43:54 EDT 2018


On Sun, Sep 30, 2018 at 10:23 AM Chris Angelico <rosuav at gmail.com> wrote:

> On Mon, Oct 1, 2018 at 12:18 AM David Mertz <mertz at gnosis.cx> wrote:
> > Bonus points for anyone who knows the actual maximum size of Python ints
> :-).
>
> Whatever the maximum is, it's insanely huge.
> Want to share what the maximum actually is? I'm very curious!
>

Indeed.  It's a lot bigger than any machine that will exist in my lifetime
can hold.

int.bit_length() is stored as a system-native integer, e.g. 64-bit, rather
than recursively as a Python int.  So the largest Python int is
'2**sys.maxsize` (e.g. '2**(2**63-1)').  I may possibly have an off-by-one
or off-by-power-of-two in there :-).


-- 
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180930/c6e53748/attachment.html>


More information about the Python-ideas mailing list