3 ms·
It doesn't even need to go all the way, it is supper easy to shift the precision depending on the input. For example 0.01 + 2.01 can already be written like ((
by 6510 3y ago
It doesn't even need to go all the way, it is supper easy to shift the precision depending on the input.
For example 0.01 + 2.01 can already be written like ((100*0.01) + (100*2.01)) / 100 which seems trivial to implement in the language.
with something like 1000000000000000.0000001 + 1000000000000002.0000001 it seems to me that one could split the operation into 2?
One could even discard 2 numbers worth of accuracy and have a representation of 1/3 and 2/3. I'm not that attached to 4294967295 Having 1/3 would be more useful.
Why would we call an implementation correct if it produces the wrong result?
- taeric 3y agoYou might be interested in https://en.wikipedia.org/wiki/Numerical_tower https://en.wikipedia.org/wiki/Numerical_tower.
- 6510 3y agoI'm really bad at math and completely unfamiliar with pretty much every relevant implementations. That makes it even worse that the implementation looks like.... well.... dumb shit? How does one do anything without considering the input?
- taeric 3y agoNot sure why you would be insulting on it? My understanding was that it works really well; as does IEEE floating numbers, all told. Understanding the constraints and reasoning behind things goes a long way.