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

Re: arithmetic anomaly

On Fri, Mar 26, 2021 at 3:36 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:

Ok, for now I know that zsh and probably everybody else will compute endless reams of garbage if you let it.

Computers do what you ask them to do. The problem is that you are asking it to do one thing while expecting something else.

When you start programming, you can think of "integer" and "float" variables as mathematical entities that behave like numbers (integer and real respectively). Once you get more experiences you need to realize that this is false. The sooner you do this, the more effective you'll be.

.... I'm asking why the 'Level: 100' result isn't just aborted after 15
digits given that all the rest is garbage?

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.


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