Friday 16 February 2018

Difference between float and double


1.Precision:

Float:
    Single precision (1 bit for sign, 8 bits for exponent, 23 bits for fraction)
Double:
     Double precision (1 bit for sign, 11 bits for exponent, 52 bits for fraction)

2.Size:

Float:
      4 Bytes (32 Bits)
Double:    
       8 Bytes (64 Bits)

3.Range:

Float:
    -3.4E+38 to +3.4E+38
Double:
      -1.7E+308 to +1.7E+308

4.Accuracy:

Float:
    6 decimal digits
Double:
   15 decimal digits  

0 comments:

Post a Comment

Tech UOG