المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Question about double #INF and #NAN



C++ Programming
11-28-2009, 02:00 PM
Does anyone understand the bit-wise representations of #INF and #NAN for the type double? Or could you point me to some real information on the internet?

Also, what is the difference between Quiet NAN and Signaling NAN?

I have been trying to find it with google all morning and I have found a lot of claiming to know but no actual knowledge.

I know that for type float the bits are:
0x7FFFFFFF; // #NAN
0x7F800000; // #INF

I believe that for type double the bits would:
0x7FFFFFFFFFFFFFFF; // #NAN
0x7FF0000000000000; // #INF

However, this is just changing the exponent from 8 to 10 bits and assuming that if would be the same. I would feel much better if I could find some supporting documentation.