3 ms·
I find it hard to get that worked up about this. The positions are accurate at least, and if you're really so hard up for space that saving a couple of digits i
by remus 7y ago
I find it hard to get that worked up about this. The positions are accurate at least, and if you're really so hard up for space that saving a couple of digits is going to make all the difference then you can think about it for 5 mins and choose a precision/storage trade off that's appropriate for you.
- maxerickson 7y agoThe representation of the numbers doesn't convey any information about accuracy, and it's at least a good practice to store data in a way that conveys the precision it was gathered with.
- yoz-y 7y agoThe issue then is that there is no reasonable primitive format to store a “real number with a small decimal precision”. Arguably storing these as ints would be better but then everybody would need to agree on the denominator.
- protonfish 7y agoIt is frustrating (to me, at least) that there is no common primitive data type the stores precision. But it isn't rocket surgery to store two floating-points (a value and precision) in a structure and format it properly for display.
- mark-r 7y agoAre you proposing doing away with IEEE 754? That's probably the origin of all these extra digits.
- maxerickson 7y agoNot at all. I'm suggesting people think about what they are doing. Blindly sticking numbers into a format that is designed to be computationally efficient is not a great way to store data. That doesn't mean that a computationally efficient representation is useless.
- mark-r 7y agoAnd I'm suggesting that using the built-in floating point representation is a good thing overall, even if it doesn't allow you to specify a precision.
- maxerickson 7y agoI'm confused by this reply. Like I said "Not at all.". But the point is, if you have some data that you want to communicate, it is also a good idea to store the precision.
- mark-r 7y agoIt's actually very rare that you need to know the precision of a number, and it's thrown away as soon as you read the value into a standard floating point variable. Keeping the precision is usually more trouble than it's worth.