Boris, how about this as a replacement for your #testNaN2 method? It does not use the sin() and tan() functions in the C math library, and I think that it captures the intent of your original test. I should work correctly on little-endian and big-endian machines.
Is this OK? If so I'll suggest including it with your original posting (Stef is waiting to harvest it).