When does storing doubles make sense?
Assuming you read the data off a decimal-notation CSV (e.g. with values such as “5.03”), does it make sense to use mysql’s DOUBLE type? Won’t there be needless round-off errors?
When does storing doubles make sense? Assuming you read the data off a decimal-notation
Share
You should use
doublenumbers when you need to store really small or huge numbers. Something like9.837262 x 10^-567. Other than that, I’d use fixed precision numeric types to avoid the rounding errors you are mentioning.Nowadays, I don’t see “saving space” as a valid reason to use
doubleinstead of numeric values, but there can be some very special scenarios where this reason might be valid.