On Fri, Apr 18, 2003 at 02:23:39PM +1000, Erik de Castro Lopo wrote:
I can't
imagine that such a simple NAN could bring your computer to it's
knees!
Bascially, the FPU is optimised for handling regular floating point numbers.
Whenever it has to do an operation involving NANs it slows down considerably.
On lots of vector (SIMD) processing units you can it not to generate or
process NANs or Infs, so it doesn't go into those corner cases. I think
you can on the SSE, which could explain why some people report improved
speed by doing all the simple FP operatatins in SSE instead of the 387.
Theres something upsetting about the fact that NAN is neither > 0.0 or <=
0.0. :)
And ofcourse theres all the horror stories of people encoding data into
the "dead bits" of a stream of NANs, when they have systems that only
stream floats. A collegue of mmine complained the SOAP was useless becuase
it encodes all NANs as "NAN", not the bit pattern, so some of his software
stopped working. Argh.
- Steve