Boost logo

Boost :

From: Johan Råde (rade_at_[hidden])
Date: 2006-07-26 09:32:22


John Maddock wrote:
> Johan Råde wrote:
>> Comments?
>> Anyone wants to add more #if's?
>
> Quite a few! :-)
>
> See attached.
>
> John.

Impressive. You seem to have thought of everything. I'm just a bit
concerned about efficiency. For instance, if I call your isnan and I use
  VC++, then the following happens:

1. _fpclass is called
2. a switch statement is called to translate the result
3. the translated result is compared against FP_NAN

Just doing x != x must be a lot faster, and works, at least on VC++ 7.1,
even with compiler optimizations turned on.

I have situations where I want to check every element in an array with
more than 100,000,000 elements, so I care about efficiency.

--Johan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk