
26 Jul
2006
26 Jul
'06
1:32 p.m.
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