|
Boost : |
From: John Maddock (john_at_[hidden])
Date: 2005-12-01 08:29:19
For a while now I've been meaning to clean up my floating-point
classification code to provide a more reliable way of testing for Nan's and
infinities.
The new TR1 complex number code could really use this to improved it's
reliability. I believe Robert Ramey was looking for this functionality for
serialisation, and frankly it's hard to write any serious floating point
code without it.
So... attached is a first version of an fpclassify implementation for Boost
(if there's interest). As long as this one works (not a given
unfortunately) then it's obviously trivial to sit isnan, isinfinity etc on
top of it.
So.... I'm looking for testers to run the attached program on as many
different platforms/compilers as possible, basically I want to see if
there's any mileage in this or if I'm on to a looser with this code!
Please build the test program with optimisations turned on: many compilers
make non-IEEE arithmetic assumptions once you tell them to optimise the
code.
Tested so far:
Win32:
VC6: Can't detect signaling NaN's (_isnan is broken).
VC7, 7.1, 8: OK
Intel 7, 8, 9: OK provided you're not using the VC6 runtime.
GCC cygwin: OK.
Borland 5.6.4: So broken I don't know where to begin :-(
HP-UX:
gcc-3.4.2: OK.
aCC: OK (native fpclassify broken for long doubles, but portable version
works).
Tru64:
cxx : OK (but can't test infinities/NaN's as they're not supported?
Suse Linux:
gcc-3.3.3 : OK.
Many thanks, John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk