views:

34

answers:

1

Hi,

i want to figure out why expressible numbers in the IEEE floating point standard is 10^+38 - -10^38 (and similarly for the +ve). most textbooks just make this statement of fact, im grappling with why. ie. how would you calc this range?

Many thanks

A: 

You are talking abount IEEE 754 single-precision (32-bit) floating point representation. In this format, maximum value of the exponent is 127. The representation is base-2, thus maximum possible value is about 2^127. Let's convert it to decimal: 127 * log(2) / log(10) ≈ 38.23. That's why max value representable by a 32-bit float is approx. 10^38. You can find more details on the IEEE 754 floats in the linked Wikipedia article.

atzz