Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Evolution is a million line computer program falling into place by accident.


devel / comp.lang.python / Re: Precision Tail-off?

SubjectAuthor
o Re: Precision Tail-off?Michael Torrie

1
Re: Precision Tail-off?

<mailman.1822.1676415045.20444.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=21692&group=comp.lang.python#21692

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: torr...@gmail.com (Michael Torrie)
Newsgroups: comp.lang.python
Subject: Re: Precision Tail-off?
Date: Tue, 14 Feb 2023 15:50:41 -0700
Lines: 17
Message-ID: <mailman.1822.1676415045.20444.python-list@python.org>
References: <CAP=-cKVbQ6yj_QuwykJ_WifJfnSggowPDwYtnfvQ6FyF2w5b_g@mail.gmail.com>
<597ae645-2c4e-bbfa-5ed1-c826333f4db0@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de BB0CtPtbjHT5L1G4Wa/HzgJh5vHN5VdLuyayhT/eZ7/A==
Return-Path: <torriem@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=T4fjRXBU;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.031
X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'explanation': 0.07;
'floating': 0.09; 'questions:': 0.09; 'yes.': 0.09; 'behaviour':
0.16; 'c++,': 0.16; 'forever.': 0.16; 'limitations.': 0.16;
'skip:. 20': 0.16; 'wrote:': 0.16; 'python': 0.16; 'message-
id:@gmail.com': 0.18; 'uses': 0.19; 'bug': 0.19; 'to:addr:python-
list': 0.20; 'language': 0.21; 'languages': 0.22; 'binary': 0.26;
'sense': 0.28; 'header:User-Agent:1': 0.30; 'but': 0.32; 'there':
0.33; 'same': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'received:209.85.166': 0.35;
'from:addr:gmail.com': 0.35; "it's": 0.37; 'received:209.85':
0.37; 'received:192.168': 0.37; 'means': 0.38; 'received:209':
0.39; 'two': 0.39; 'use': 0.39; 'exact': 0.40; 'point.': 0.62;
'subject': 0.63; 'definition': 0.64; 'well': 0.65; 'numbers':
0.67; 'known': 0.84; '0.2': 0.84; 'exhibit': 0.84; 'fraction':
0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=content-transfer-encoding:in-reply-to:from:references:to
:content-language:subject:user-agent:mime-version:date:message-id
:from:to:cc:subject:date:message-id:reply-to;
bh=CqX/GhUfgY8Jq3e3+zLTSk5MpzN2SpGW1KzVpTtIqKk=;
b=T4fjRXBUehjggrqmkJCLDsPf6He2nvMEYQ9/mU3HV4EQ+BRYt+1jOVUA7VIg0qhcWS
8OOpqRPdRH7fmGW4ElOXuh9J/aq/pD+WGTxEqbbra4242zivKlMvC8pow6Vit0YMvWSX
pJZw4YNcIJ3fKTMqYKubbkOr+P/OxqQo5q30/ibPSz9noDnfMhydZwiSpidxz5fVHEiE
U/h4BjEY+A9BYVCShQyUoGK4Ww0M2Qo0kDaG7Ysi/xfY2JqmmAWcx0E2OEj7pM/r3pLW
N96bcBEFQeQ+OPDvNO3DRnAzs4aSdx53fjtCfLnWKQWb6fFA6J62T6+Sz68TLWHjeYQk
x6jA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=content-transfer-encoding:in-reply-to:from:references:to
:content-language:subject:user-agent:mime-version:date:message-id
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=CqX/GhUfgY8Jq3e3+zLTSk5MpzN2SpGW1KzVpTtIqKk=;
b=JJgNzvfELM6xUO3bn8LBi2heLiAy1qBM/NLYL8YkON/qI5ruDlKRgO+NcERnPgbQtG
ZLUbcyvh9Kyu6zi5y38sC2BHzyKRwTfhuZ1KQVgy9GhuEPgg7dEQWOZnllhUcpkGHEyr
zfrMaLYt5BGyaOXSNbMpevfw/FcxEtMaOBKwbkX568PAlmJZZPZSos8BDt+wQdfHgbpg
s0VG7gwP4qppxnw80vPxOunqQofK/kggqorOjGJBEUotIeL/dRdSCIZr/XJdKJW4hqWJ
WDZ0RvHauw+4wFLDvvDn7Tjh2qDuShvXtkrl7RCCJVwB1bNYU9HsUVxIkr5Fsa8Ik2Ww
wH+w==
X-Gm-Message-State: AO0yUKVN0iRE8G2Bcdr/krDOp7VLN2R75aMCWteqmzgvfh7Cj3PgJoGO
UdYxS3oiy7wZ9oSKlRGZDJDCceGNWpY=
X-Google-Smtp-Source: AK7set/cSpZq1qX+EModSa+7EBrGy3SqXh1MjITCaDq3rkeG9OA2sLc23LPfoTNX5mao+p2lRmRhVw==
X-Received: by 2002:a05:6e02:66b:b0:313:f9df:2f4d with SMTP id
l11-20020a056e02066b00b00313f9df2f4dmr246775ilt.29.1676415043340;
Tue, 14 Feb 2023 14:50:43 -0800 (PST)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.5.0
Content-Language: en-US
In-Reply-To: <CAP=-cKVbQ6yj_QuwykJ_WifJfnSggowPDwYtnfvQ6FyF2w5b_g@mail.gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <597ae645-2c4e-bbfa-5ed1-c826333f4db0@gmail.com>
X-Mailman-Original-References: <CAP=-cKVbQ6yj_QuwykJ_WifJfnSggowPDwYtnfvQ6FyF2w5b_g@mail.gmail.com>
 by: Michael Torrie - Tue, 14 Feb 2023 22:50 UTC

On 2/14/23 00:09, Stephen Tucker wrote:
> I have two questions:
> 1. Is there a straightforward explanation for this or is it a bug?
To you 1/3 may be an exact fraction, and the definition of raising a
number to that power means a cube root which also has an exact answer,
but to the computer, 1/3 is 0.333333333333333 repeating in decimal,
which is some other fraction in binary. And even rational numbers like
0.2, which are precise and exact, are not in binary
(0.01010101010101010101). 0.2 is .0011011011011011011 on and on forever.

IEEE floating point has very well known limitations. All languages that
use IEEE floating point will be subject to these limitations. So it's
not a bug in the sense that all languages will exhibit this behavior.

> 2. Is the same behaviour exhibited in Python 3.x?
Yes. And Java, C++, and any other language that uses IEEE floating point.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor