Difference between float and double? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Difference between float and double?

7th Aug 2016, 6:13 AM
jigoku_tenshi
2 Answers
+ 4
"float" takes up less space but is less precise. "double" takes up more space but is more precise.
7th Aug 2016, 6:20 AM
Samuel Neo
Samuel Neo - avatar
+ 2
according to IEEE754 float is 32 bits data type and double is 64 bits data date. to store decimal numbers we have three part mantis to save normalized floating part,second part that save power of ten for first part and sign bit of mantis. in double data type mantis bit are large and give us fraction precision up to 16 digits and power can grow up to 324. float range +/-1.7E45..+/-3.4E38 double range +/-5E-324 .. 1.4E308
7th Aug 2016, 11:03 AM
Muhammadreza Kaloukh
Muhammadreza Kaloukh - avatar