[issue22198] Odd floor-division corner case

Raymond Hettinger report at bugs.python.org
Fri Aug 15 07:27:16 CEST 2014


Raymond Hettinger added the comment:

> ideally, a floating-point operations works as though the
> corresponding mathematical operation were performed exactly 
>on the inputs (considered as real numbers), followed by a rounding
> step that takes the resulting real number and rounds it to the 
> nearest floating-point number.

FWIW, the Decimal Arithmetic Specification was created around the same principle.   Accordingly, it gets the answer that Mark expected:

  >>> from decimal import Decimal
  >>> Decimal('-0.5') // Decimal('Inf')
  Decimal('-0')

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22198>
_______________________________________


More information about the Python-bugs-list mailing list