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 tim.peters
Recipients David Hwang, steven.daprano, tim.peters
Date 2020-02-02.05:54:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Arguments to `remainder()` are converted to floats, and the returned value is also a float.  These specific arguments convert to the same float:

>>> a = 12345678901234567890
>>> b = 12345678901234567891
>>> float(a) == float(b)

And the float they convert _to_ retains only the 53 most-significant bits of the inputs:

>>> int(float(b))
>>> c = _
>>> c.bit_length()
>>> bin(c)

Note that the last 11 bits are zeroes, and 64 - 11 = 53.

So this is all doing what it's intended to do, and won't be changed.

I'm leaving this open, though, in case someone thinks the docs should be clarified.  But the same things apply to _many_ functions in the `math` module:  unless the docs specifically say they work with integer arguments, integer arguments are converted to float.

Oops!  Someone else already closed this while I was typing.  That's fine by me too ;-)
Date User Action Args
2020-02-02 05:54:12tim.peterssetrecipients: + tim.peters, steven.daprano, David Hwang
2020-02-02 05:54:12tim.peterssetmessageid: <>
2020-02-02 05:54:12tim.peterslinkissue39525 messages
2020-02-02 05:54:12tim.peterscreate