Thursday, July 9, 2009

In C language why a float variable is ranging from only -38 to +38.?

In C language why a float variable is ranging from only -38 to +38 and why it can store a mantissa with 7 significant digits only.

In C language why a float variable is ranging from only -38 to +38.?
That is from the IEEE Std 754-1985 standard. It splits a 32 bit value into 1-bit sign, 8-bit exponent and 23-bit fraction. That is common limits on floats in most current languages. If you need more, go to double (64-bit), which is -308to +308 with 16~17 sig digits.


No comments:

Post a Comment