Are there any situations where it would make more sense to use a single datatype instead of a double? From my searching, the disadvantage to a double is that it requires more space, which isn’t a problem for most applications. In that case, should all floating point numbers be doubles?
A little background info:
I’m working with an application that deals with a lot of data about coordinates and chemicals. A few customers have noticed that when importing spreadsheets of data, some values with high precision are rounded down the precision of a single.
On most desktop applications, yes.
Though if you have a huge array of them, halving the size of that could be significant enough to be worthwhile if you don’t need the precision.
Especially given that pretty much all consumer desktops have double-precision floating-point arithmetic done in hardware.