[om] comparing OM Floats (XML Representation)

Richard Fateman fateman at cs.berkeley.edu
Sun Nov 30 01:05:32 CET 2003


If you want to use IEEE floats, then the rules for equality
(etc) are all pretty much defined.  You may wish to distinguish
(as does Common Lisp) several kinds of equality.

EQ  equality means  "same objects".  This is like address comparison.
EQL  means isomorphic  (think of it as 'printing the same').
= means numeric equality in which 0.0e0 = 0 = 0.0d0 = #c(0 0)  [complex 
number]

In the case of floats, you might do this:
(setf x (make-a-NaN))
(EQ x x) --> true
(=  x x) --> false

NaNs are unordered with respect to each other or floats,
and anyone who tries to impose an ordering is in for trouble.

Richard Fateman

a voting member of the IEEE 754 committee.





--
om at openmath.org  -  general discussion on OpenMath
Post public announcements to om-announce at openmath.org
Automatic list maintenance software at majordomo at openmath.org
Mail om-owner at openmath.org for assistance with any problems



More information about the Om mailing list