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 skrah
Recipients Arfrever, alex, belopolsky, casevh, mark.dickinson, pitrou, rhettinger, skrah, tim.peters
Date 2014-09-22.19:48:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20140922194839.GA22908@sleipnir.bytereef.org>
In-reply-to <1411414843.09.0.670249390173.issue22444@psf.upfronthosting.co.za>
Content
Alexander Belopolsky <report@bugs.python.org> wrote:
> Raymond suggested that "The PEP 3141 should be revised to say that floor division is defined to return a value that is *equal* to an Integral".

I guess it should say "equal to an Integral or a special value".

> Since nan or inf are not *equal* to any Integral, the current implementation does not comply.  In the absence of a recommendation in the PEP, implementers of new numeric types are left with little guidance because existing types are inconsistent:
> 
> >>> Decimal('inf') // 1
> Decimal('Infinity')
> >>> float('inf') // 1
> nan

I think both should return inf.
History
Date User Action Args
2014-09-22 19:48:40skrahsetrecipients: + skrah, tim.peters, rhettinger, mark.dickinson, belopolsky, pitrou, casevh, Arfrever, alex
2014-09-22 19:48:40skrahlinkissue22444 messages
2014-09-22 19:48:40skrahcreate