zsh-users
 help / color / mirror / code / Atom feed
From: Roman Perepelitsa <roman.perepelitsa@gmail.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: arithmetic anomaly
Date: Fri, 26 Mar 2021 15:49:13 +0100	[thread overview]
Message-ID: <CAN=4vMqMe-dFWSWLnsn=K9e_gqs+-QedXU_QqOtiqeYO6cV8bg@mail.gmail.com> (raw)
In-Reply-To: <6d70bc8d-73d3-7866-6485-ee89dafdebc9@eastlink.ca>

[-- Attachment #1: Type: text/plain, Size: 927 bytes --]

On Fri, Mar 26, 2021 at 3:36 PM Ray Andrews <rayandrews@eastlink.ca> 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.

[-- Attachment #2: Type: text/html, Size: 1475 bytes --]

  reply	other threads:[~2021-03-26 14:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-25 15:52 Ray Andrews
2021-03-25 20:40 ` Lawrence Velázquez
2021-03-25 22:44   ` Ray Andrews
2021-03-25 22:54     ` Roman Perepelitsa
2021-03-25 23:57       ` Ray Andrews
2021-03-26  0:16 ` Oliver Kiddle
2021-03-26  0:37   ` Ray Andrews
2021-03-26 10:35     ` Roman Perepelitsa
2021-03-26 14:36       ` Ray Andrews
2021-03-26 14:49         ` Roman Perepelitsa [this message]
2021-03-26 15:35           ` Ray Andrews
2021-03-26 17:09             ` Lawrence Velázquez
2021-03-26 21:45               ` Ray Andrews
2021-03-26 21:59                 ` Lawrence Velázquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN=4vMqMe-dFWSWLnsn=K9e_gqs+-QedXU_QqOtiqeYO6cV8bg@mail.gmail.com' \
    --to=roman.perepelitsa@gmail.com \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).