[Python-Dev] Python-Dev Digest, Vol 69, Issue 143 (original) (raw)
Mark Dickinson dickinsm at gmail.com
Fri Apr 17 17:42:10 CEST 2009
- Previous message: [Python-Dev] Python-Dev Digest, Vol 69, Issue 143
- Next message: [Python-Dev] Issue5434: datetime.monthdelta
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, Apr 17, 2009 at 3:58 PM, Scott David Daniels <Scott.Daniels at acm.org> wrote:
Non-associativity is what makes for floating point headaches. To my knowledge, floating point is at least commutative.
Well, mostly. :-)
from decimal import Decimal x, y = Decimal('NaN123'), Decimal('-NaN456') x + y Decimal('NaN123') y + x Decimal('-NaN456')
Similar effects can happen with regular IEEE 754 binary doubles, but Python doesn't expose NaN payloads or signs, so we don't see those effects witihin Python.
Mark
- Previous message: [Python-Dev] Python-Dev Digest, Vol 69, Issue 143
- Next message: [Python-Dev] Issue5434: datetime.monthdelta
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]