Frequently, in my programming experience, I need to make a decision whether I should use float
or double
for my real numbers. Sometimes I go for float
, sometimes I go for double
, but really this feels more subjective. If I would be confronted to defend my decision, I would probably not give sound reasons.
When do you use float
and when do you use double
? Do you always use double
, only when memory constraints are present you go for float
? Or you always use float
unless the precision requirement requires you to use double
? Are there some substantial differences regarding the computational complexity of basic arithmetics between float
and double
? What are the pros and cons of using float
or double
? And have you even used long double
?