When do we use variable type - double ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

When do we use variable type - double ?

Use of Variable type - double

6th Mar 2018, 7:52 AM
Vedant Daigavane
Vedant Daigavane - avatar
3 Answers
+ 2
In short, although double allows for higher precision in its representation, for certain calculations it would produce larger errors. The "right" choice is: use as much precision as you need but not more and choose the right algorithm. So, double is more precise but could potentially produce larger errors, whereas float is not as precise but it is more error-free.
6th Mar 2018, 7:59 AM
Gami
Gami - avatar
+ 2
Hey! Where, for example, you need a more accurate result of dividing two numbers. Hope it's help :)
6th Mar 2018, 8:01 AM
stKhaDgar
stKhaDgar - avatar
0
There is no such type - double in Python, type - float can satisfy your need.
21st Aug 2018, 5:19 PM
Harlan Snow