0
Please tell the exact difference between float and double
5 Answers
+ 9
Precision is the main difference where float is a single precision (32 bit) floating point data type, double is a double precision (64 bit) floating point data type.
+ 1
There's difference in the size taken by them in memory area.
+ 1
Float numbers are stored in 32 bits, from which 23 bits are mantissa (the fractional part), 8 bits are the exponent (of base 2^x) and one bit is the sign.
Double numbers are stored in 64 bits, in them mantissa has 52 bits, exponent has 11 bits and one sign bit.
More mantissa bits equals more precision. Float numbers are precise to circa 7 digits. Double are precise to 15 digits, but require twice as much memory to use, and sometimes can be slower.
0
size is the major difference
0
Precision is the main difference where float is a single precision (32 bit) floating point data type, double is a double precision (64 bit) floating point data type and decimal is a 128-bit floating point data type. ... The main difference between each of these is the precision.
loat - 7 digits (32 bit)
Double-15-16 digits (64 bit)
Decimal -28-29 significant digits (128 bit)