From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32545 invoked from network); 26 Mar 2021 14:50:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Mar 2021 14:50:03 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1616770203; b=YNi4ri7HwFnHTw4Ft53meLK/ZFAurXsr2S3BSL6BoSwyy/VKbKiCATsrlw1tFgNPOhVJ6ypg+8 3X6jzCN+PTDKPlqEJyeiLHlk42iZfbJrG0l6/sXCnuMTDC+Il5VLrSS3u1ElzaHqRhQ01+B0bb lieczu+0K2xy+oDW+hbESDcWJZr0Iht+ueyFnVPJ4JdtVdBN7+DDlS3famLtb+NlW7iWhKpf3+ oQM6EvpFd4GjFIZRTuwHViOIeMnzqvwv3ZamQ5unJWPyiyptlM+ORhmKSrXzMotIRAOqH+qcTq sdsE7rjbuHwkl8AN+2EmgijRo7s9x3jME4WS3yDtzga/IQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-il1-f176.google.com) smtp.remote-ip=209.85.166.176; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1616770203; bh=lDJtR3yRgVqsa3rhCEm5Ebk1/ANjXUXYYZQYNUzGW1w=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=Q8zo41mh3r1LyM4t4bb+Uc7diiYo1jFB8ziDCOm0Mb6yw/sEGqCBJ+MqbvwYMC3LpRw+o6RRxs onzbziFXaGStt0SxVtR77ekNcV/IUOCO/6yHqwewUw8FTlYNXHrQvttWvv/C+AHRgkC24exbTf 4hW8u+RlSe2mnBH9rw558mD0eEUJDZ+SE5gROG0HQ7BahVWDO99bvyKeOo7hb/lYw8g2wSp7aR EBjnGJ3IiFjuHhwqSN/nGSlyz+ekMpDm+STllP5RYVi5a9h1w96dw8QZSVFS4edtJ5xrjar9ch nygLZKbx8WpeQMKtAzuXAnO9cZh1zTYaZVnTOam8DO3lbQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=lDJtR3yRgVqsa3rhCEm5Ebk1/ANjXUXYYZQYNUzGW1w=; b=PvprUzOBGSdsttGuI5UJ1ux/6z zW12LIb4+LEIfy3N7n5Z8Vp0wW+PnHIaSdu9bhANFNMchqBwULdIQenWc5nJSrdHwaplfrmQgzAGr w+m+uEHj03XfZeQKfgxXh42G6yGigDYBDnzWcO9ulDTJdVjM+96FG+QSBbrITyx8eynU9W6Rg3qgf ZgECjl5tubJ0Lc09A2J5GaAwAwpDoNOudaB8JrxvOJP3tFVXnm94E6jlSmQmtgBktdCWX7ZpRiwJT UDtdDXdASwfqnAFvHL12ZcqcGz4jc1Z7ql+e8wIPxmpb89/DP7srevHVZ4cg42xatlOcfq9nGPgU2 qu1E3xrQ==; Received: from authenticated user by zero.zsh.org with local id 1lPnmk-000OK3-Cl; Fri, 26 Mar 2021 14:50:02 +0000 Authentication-Results: zsh.org; iprev=pass (mail-il1-f176.google.com) smtp.remote-ip=209.85.166.176; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-il1-f176.google.com ([209.85.166.176]:38841) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lPnmA-000NLx-8z; Fri, 26 Mar 2021 14:49:27 +0000 Received: by mail-il1-f176.google.com with SMTP id d10so5236363ils.5 for ; Fri, 26 Mar 2021 07:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lDJtR3yRgVqsa3rhCEm5Ebk1/ANjXUXYYZQYNUzGW1w=; b=VEi8ooX3wDX09mZZW83KaC/Y4fsORyrG7ULs2EFxO+lVM1aCT8hnrK/4bom+aWMx+t WLiLmfOcxfZE9eMZEc1x/2wrQD6PXkCS/7qc8mlQCYYBAtEQJ98k1BsXc/sHfj6aPRP9 zm4OiroG3KZ14xQK8+SUY527azruqBxgNA2nN5R6aJoq+0BsT/WyhcbXQxGM/Lq6IROg P/dv36JAChbH0068hD+BZWqJEgWXej7WgqQU+F2eHLJfbgrbG70IZrM3HQWZICphjJm4 sH0WJKgwiEg8PF1p4hqQdIMQG8gwVa/5cJnNI4xKqxJFRt1BmzmltLxfBNqKAuDgUMy+ 5VpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lDJtR3yRgVqsa3rhCEm5Ebk1/ANjXUXYYZQYNUzGW1w=; b=lTlf9ppsqSGPbI8D0uK8wAOF6sUMkY+szPGsIHQlIO/S9M9yp9eOmFP4SbrzTguQdi ecz6ny2ZT6wW1QfzF0jMjA+dWDeFeCrMlt8Jw1Xt7eUIyQMEImLlnefF+Tpjxm4TKH1V bDb7CWsjXTZNtaiG4wuY88wrQNjsnmGB82F20yLQ/Tw/xX4Klf/Pcj027KNwHobmc82W IIBg7kt8e+NBUsVRbQVLiCkCULeUVihCt9Sw8qpCuZMaQfs/marO1tpelhv9wM/KkAOh b38+SYZqm91IDeZKDYifZ2HNsxgsN1z4wF+Mpe1l6KxoovLa8Bkt6XZA7EeiR4BaHr+z jipA== X-Gm-Message-State: AOAM532rtTsCaOqCj8K1CukZbn3Qqljkka0BpcKNVqpwlnn6uZWKDBXj fN2tph6zZfzl9cwxTVMwAwrRWgIJrhFm3fETs80= X-Google-Smtp-Source: ABdhPJwwFH7yEQAv5aI9h/gptXFj9iQ3FZmkMD0lIDZS9Ukxs9wFlq4BcGFSWkExNt8d/PMoQWr3+kI94RXL6YtdN6s= X-Received: by 2002:a05:6e02:148a:: with SMTP id n10mr1463432ilk.168.1616770165084; Fri, 26 Mar 2021 07:49:25 -0700 (PDT) MIME-Version: 1.0 References: <0227b30d-4f09-2c8b-1248-557859d875ce@eastlink.ca> <91303-1616717760.288585@Iyj2.F9RA.VD0P> <6d70bc8d-73d3-7866-6485-ee89dafdebc9@eastlink.ca> In-Reply-To: <6d70bc8d-73d3-7866-6485-ee89dafdebc9@eastlink.ca> From: Roman Perepelitsa Date: Fri, 26 Mar 2021 15:49:13 +0100 Message-ID: Subject: Re: arithmetic anomaly To: Ray Andrews Cc: Zsh Users Content-Type: multipart/alternative; boundary="0000000000005f982805be71a379" X-Seq: 26610 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --0000000000005f982805be71a379 Content-Type: text/plain; charset="UTF-8" On Fri, Mar 26, 2021 at 3:36 PM Ray Andrews 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. --0000000000005f982805be71a379 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Mar 26, 2021 at 3:36 PM Ray Andre= ws <rayandrews@eastlink.ca= > wrote:

Ok, for now I know that zsh and probably everybo= dy 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 experience= s 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 abor= ted after 15
digits given that all the rest is garbage?

<= div>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 b= ecause the real number 0.1 is not representable.

R= oman.
--0000000000005f982805be71a379--