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 mark.dickinson, skrah, steven.daprano, tim.peters
Date 2014-08-14.19:40:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1408045249.79.0.627071551442.issue22198@psf.upfronthosting.co.za>
In-reply-to
Content
I'm OK with -1, but I don't get that or -0.0 on 32-bit Windows Py 3.4.1:

Python 3.4.1 (v3.4.1:c0e311e010fc, May 18 2014, 10:38:22) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> -0.5 // float('inf')
nan

So maybe NaN is the best answer ;-)

In favor of -1.0:  that _is_ the limit of the mathematical floor(-0.5 / x) as x approaches +infinity.

In favor of -0.0:  it "should be" mathematically that floor_division(x/y) = floor(x / y), and floor(-0.5 / inf) = floor(-0.0) = ... well, not -0.0!  floor() in Py3 is defined to return an integer, and there is no -0 integer:


>>> floor(-0.0)
0

That's +0.  So I see no justification at all for -0.0 in Py3.  -1 seems the best that can be done.  The NaN I actually get doesn't make sense.
History
Date User Action Args
2014-08-14 19:40:49tim.peterssetrecipients: + tim.peters, mark.dickinson, steven.daprano, skrah
2014-08-14 19:40:49tim.peterssetmessageid: <1408045249.79.0.627071551442.issue22198@psf.upfronthosting.co.za>
2014-08-14 19:40:49tim.peterslinkissue22198 messages
2014-08-14 19:40:49tim.peterscreate