*X-seq*: zsh-users 26610*From*: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>*To*: Ray Andrews <rayandrews@xxxxxxxxxxx>*Cc*: Zsh Users <zsh-users@xxxxxxx>*Subject*: Re: arithmetic anomaly*Date*: Fri, 26 Mar 2021 15:49:13 +0100*Archived-at*: <https://zsh.org/users/26610>*Archived-at*: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-03/CAN%3D4vMqMe-dFWSWLnsn%3DK9e_gqs%2B-QedXU_QqOtiqeYO6cV8bg%40mail.gmail.com>*In-reply-to*: <6d70bc8d-73d3-7866-6485-ee89dafdebc9@eastlink.ca>*List-id*: <zsh-users.zsh.org>*References*: <0227b30d-4f09-2c8b-1248-557859d875ce@eastlink.ca> <91303-1616717760.288585@Iyj2.F9RA.VD0P> <cb16b987-9521-e2b7-3bbc-8b71677b913c@eastlink.ca> <CAN=4vMpq2ECpWkFt5mAO1rwCGp0Q+UYCxnPr5kT6fReXhycSZQ@mail.gmail.com> <6d70bc8d-73d3-7866-6485-ee89dafdebc9@eastlink.ca>

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.

Roman.

**Follow-Ups**:**Re: arithmetic anomaly***From:*Ray Andrews

**References**:**arithmetic anomaly***From:*Ray Andrews

**Re: arithmetic anomaly***From:*Oliver Kiddle

**Re: arithmetic anomaly***From:*Ray Andrews

**Re: arithmetic anomaly***From:*Roman Perepelitsa

**Re: arithmetic anomaly***From:*Ray Andrews

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