What is the difference between float and double? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the difference between float and double?

Can anyone explain?

8th Jun 2019, 9:43 AM
Parth Lakhani
Parth Lakhani - avatar
10 Answers
+ 13
• Schildt, H. (2003). C++: Complete Reference. 4th ed. New York: McGraw-Hill. Ch. 2. The range of 'float' and 'double' will depend upon the method used to represent the floating-point numbers. ( Whatever the method, the range is quite large. ) The minimum number of digits of precision for each floating-point type is: • float Typical Size in Bits — 32 Minimal Range — Six digits of precision • double Typical Size in Bits — 64 Minimal Range — Ten digits of precision
8th Jun 2019, 10:45 AM
Danijel Ivanović
Danijel Ivanović - avatar
8th Jun 2019, 6:57 PM
A͢J
A͢J - avatar
+ 3
double have longer precision than float, and a double is twice the size of float
8th Jun 2019, 9:50 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 2
Parth Lakhani about the difference or what???
8th Jun 2019, 9:53 AM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 2
Parth Lakhani longer precision = more digits behind the dot.
8th Jun 2019, 9:54 AM
luʁi
+ 1
Want some depth knowledge about it *AsterisK*
8th Jun 2019, 9:52 AM
Parth Lakhani
Parth Lakhani - avatar
+ 1
Difference *AsterisK*
8th Jun 2019, 9:53 AM
Parth Lakhani
Parth Lakhani - avatar
+ 1
Thank you guys i understood now😊
8th Jun 2019, 11:54 AM
Parth Lakhani
Parth Lakhani - avatar