by marcandrysco · 10y ago · 0 comments
So, how can we make sure that such numbers are converted correctly? The answer from Steel & White's paper is to perform arbitrary integer arithmetic and leave nothing up to chance. The Grisu3 algorithm by Loitsch showed that 64-bits correct converts about 99.5% of numbers. As you increase the amount of precision, you can improve your accuracy, but there is no guarantee that even 128-bits or 256-bits is enough to correctly convert all numbers.
Instead of trying to be 100% correct, our algorithm sidesteps the issue entirely by enumerating all failures a priori.
No comments yet.