Sunday, 6 February 2011

Memory representation of float data type in c


(Both in Turbo c compiler and Linux gcc compiler)

Float
numbers are stored in exponential form i.e.



(Mantissa)*10^ (Exponent)



Here
* indicates multiplication and ^ indicates power.

In
memory only Mantissa and Exponent is stored not *, 10 and ^.

Total
size of float data type: 32 bit

Those
bits are used in following manner:

Exponent
bit: 8

Mantissa
bit: 24

Mantissa
is signed number,

No comments:

Post a Comment