0

When would I use double instead of float?

4th Sep 2016, 12:47 PM
Ben Grinshpan
Ben Grinshpan - avatar
2 Answers
+ 2
You'll get a higher real number precision at the cost of a higher memory consumption (float variables take less space to store than doubles). On some super rare hardware there might be a performance impact between those two but nowadays with floating point units (FPUs) there is no difference anymore besides the memory.
5th Sep 2016, 12:05 AM
René Schindhelm
René Schindhelm - avatar
+ 1
when you want much more precision in your answer, like the answer you are getting with float is 4.1234567 but you want much more precise answer then you use double which will give you a answer with much more values after the point
4th Sep 2016, 4:33 PM
Harishiv Singh
Harishiv Singh - avatar