From: Johan Råde (rade_at_[hidden])
Date: 2006-07-25 08:44:25
John Maddock wrote:
> Martin Bonner wrote:
>> ----Original Message----
>> From: Johan Råde
>>> template<class T> bool is_nan(T a)
>>> return a != a;
>>> 1. Do these implementations work an all platforms?
>> I believe is_nan is vunerable to over-eager optimizers for built-in
> If implemented that way, then yes: only compilers in strict IEEE mode and
> probably with optimisations turned off will do the right thing. It won't
> work at all on platforms with non-IEEE arithmetic :-(
> Which I why I routed everything through fpclassify: try get it right once in
> one place and hopefully it doesn't turn into a maintenence problem :-)
> Of course if the platform has native floating point classification macros
> then these should be used: they're likely to be much more efficient than
> "generic" solutions. Unfortunately I found several platforms with native
> macros that didn't actually do the right thing in all cases during testing
> of that code :-(
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
You seem to have thought through these issues carefully.
When will you submit the floating point properties library to Boost?
I need it.
Based on your document and input from Paul Giaconne
I suggest the following interface:
The IEEE754 standard uses the term "denormal",
but the draft for the next revision of the IEEE754 standard uses the
term "subnormal", so "subnormal" is probably better.