Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: arithmetic anomaly



On 2021-03-26 7:49 a.m., Roman Perepelitsa wrote:

Aborted based on which condition? If the result of an operation is not representable exactly in a double? If so, then even `1. / 10` would abort because the real number 0.1 is not representable.

Ha!  You have a point there!  The article you linked talked about some of these issues, but surely in my case it's simply a plain fact that no decimal past 15 can be accurate ever?  Perhaps in practice this is not so easy to distinguish but we used to end rounding errors with that (what's it called?) the 'S' on it's side, the 'approximation' symbol.  Anyway, it's easy for me to preach since I don't have to figure out how this would work in practice.  It's easy to talk about but perhaps not so easy to code.  For now I'm awake to the issue: no accuracy past 15 digits.


Roman.





Messages sorted by: Reverse Date, Date, Thread, Author