4 ms·
A float can represent some of its range with more accuracy, and some with much less accuracy. The tradeoff could be tuned (there's probably libraries to impleme
by h2odragon 5y ago
A float can represent some of its range with more accuracy, and some with much less accuracy. The tradeoff could be tuned (there's probably libraries to implement that already im ignorant of).
Is that a 3rd interpretation? Has the whole argument gone so meta already that its mostly a definitions fight?
Edit: this makes me recall the "rounding flag" [1] and hitting an instance where the hardware was set to do something i hadn't expected. Meta-discussion about the nature of "accuracy" ensued then too.
[1] https://www.keil.com/support/man/docs/armlib/armlib_chr1358938950865.htm https://www.keil.com/support/man/docs/armlib/armlib_chr13589...
- jerf 5y ago"(there's probably libraries to implement that already im ignorant of)" Look for the word BigFloat in your choice of language. For an alternate spin, look for a "rational number" library in your choice of language.
- wongarsu 5y agoAlternatively, look for fixed point numbers (though usually that's easy enough to just do manually by switching to a smaller unit, e.g. by using numbers in cents or millivolts or whatever)
- Someone 5y ago> À float can represent some of its range with more accuracy, and some with much less accuracy. IEEE floats are guaranteed to _do_ that. They’re not distributed evenly across their range, so the absolute error of replacing a real by the closest float will vary across their range. They also aren’t distributed evenly after taking logarithms, so the relative error of replacing a real by the closest float will also vary across their range. (That is unavoidable for the reals if you want to represent zero or negative numbers)
- sharikous 5y agoWhile it is right that errors are not represented evenly even on a logarithmic scale, it is still a useful approximation to make. In fact the integer value of the binary representation of a float approximates crudely the logarithm of the float. This was used in Quake's famous inverse square root approximation
- colejohnson66 5y agoA really good video on how that worked: https://www.youtube.com/watch?v=p8u_k2LIZyo https://www.youtube.com/watch?v=p8u_k2LIZyo