[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

more about binary floating-point arithmetic



Another property of the binary floating-point arithmetic used by computers
is that the associative law doesn't hold for addition.
Evaluate these two Emacs Lisp forms:
(+ (+ (expt 10 16.2) 0.7) 0.4)
(+ (expt 10 16.2) (+ 0.7 0.4))
By the associative law, both calculations should yield the same answer.
They don't!

-- Chris

-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@xxxxxxxxxxx" with a
subject of "unsubscribe" or "help".



If you have questions about this archive or had problems using it, please send mail to:

priestdo@xxxxxxxxxxx No Soliciting!

Emacspeak List Archive | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 | 2001 | 2000 | 1999 | 1998 | Pre 1998

Emacspeak Files | Emacspeak Blog