xxxxxxxxxx
Double is more precise than float and can store 64 bits, double of the number of bits float can store. Double is more precise and for storing large numbers, we prefer double over float. For example, to store the annual salary of the CEO of a company, double will be a more accurate choice.
xxxxxxxxxx
- double has higher precision
- whereas floats take up less memory and are faster.
xxxxxxxxxx
// you cant operate between float and double, float will get converted to double
double.PositiveInfinity == float.PositiveInfinity // that is (1d/0d) == (1d/0d)