Message227303
| 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. |
|