Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #85652

Re: Floating point "g" format not stripping trailing zeros

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'subject:not': 0.03; 'context': 0.07; 'filing': 0.07; 'indicates': 0.09; 'trailing': 0.09; 'hardcopy': 0.16; 'precision,': 0.16; 'precision.': 0.16; 'removed,': 0.16; 'subject:format': 0.16; 'zero.': 0.16; 'zeros': 0.16; 'wrote:': 0.18; 'numerical': 0.19; 'thu,': 0.19; 'feb': 0.22; '>>>': 0.22; 'removed.': 0.24; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; 'have,': 0.30; 'message- id:@mail.gmail.com': 0.30; '13,': 0.31; 'doc': 0.31; 'libraries': 0.31; 'supposed': 0.32; 'says': 0.33; 'fri,': 0.33; 'could': 0.34; 'received:209.85': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'received:209': 0.37; 'somebody': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'explain': 0.39; '12,': 0.39; 'subject:" ': 0.39; 'to:addr:python.org': 0.39; 'ian': 0.60; 'within': 0.65; 'due': 0.66; 'between': 0.67; '2015': 0.84; 'cabinet': 0.84; 'fish': 0.84; 'fourth': 0.84; 'edwards': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=1tpw0dx9FnC989dxlEc47m0Sdil9tbu/T8YGZ66Wdow=; b=ed0QXaQCw4KRNRGHgaPu8Ul2HAji3TYMiH3QY/Z68P/bUMpGvL4tDrb5WkrQaKHlzP A/TypyE5biG5HFem3lRx+WkvwCcmrR4MYjuKf5RQwQB8d8E6zlXOiNHhGRCu+I4BoQ+o SPSTy0xamR6ktapxX+sVZIUAZGKvKYbyAr+1UFeuPWs+FjyGYzITbK8ClPjyojZe+8Sl Ng65ebOsklzHPjYfpgQsVx6MH2eP8Sx028AuuniQwCXGEFwDLbPvOaprAWY+0+WltgOP sepeKzf15FQE09QKsI6BYk2EuYqTnSk6yjV8ThS+fTyyE+D8XGRUkJV1ftM92U+NgA/p pzBg==
X-Received by 10.66.97.106 with SMTP id dz10mr17304734pab.66.1423846628593; Fri, 13 Feb 2015 08:57:08 -0800 (PST)
MIME-Version 1.0
In-Reply-To <mbl04r$kb6$1@reader1.panix.com>
References <CAK291fpAycSecNuV6hDnVXK+rhB0CWJTAuC3BKNUz8B4aDg2kQ@mail.gmail.com> <CAK291fpKxW_V=yCvNHj9RRoEhC=i_DYJCa9-cbjxDwRwH4-KfQ@mail.gmail.com> <mailman.18715.1423784816.18130.python-list@python.org> <mbl04r$kb6$1@reader1.panix.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Fri, 13 Feb 2015 09:56:28 -0700
Subject Re: Floating point "g" format not stripping trailing zeros
To Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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 <http://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>
Newsgroups comp.lang.python
Message-ID <mailman.18731.1423846637.18130.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1423846637 news.xs4all.nl 2972 [2001:888:2000:d::a6]:50665
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:85652

Show key headers only | View raw


On Fri, Feb 13, 2015 at 7:02 AM, Grant Edwards <invalid@invalid.invalid> wrote:
> On 2015-02-12, Ian Kelly <ian.g.kelly@gmail.com> wrote:
>> On Thu, Feb 12, 2015 at 1:23 PM, Hrvoje Nikšić <hniksic@gmail.com> wrote:
>>
>>> {:.15g} is supposed to give 15 digits of precision, but with trailing
>>> zeros removed.
>>
>> The doc says with "insignificant" trailing zeros removed, not all
>> trailing zeros.
>
> Can somebody explain the difference between "significant" and
> "insignificant" tailing zeros to somebody who barely passed his single
> numerical methods class?  [Though I have, on occasion, had to tinker
> with the innards of SW floating point libraries and could fish a
> hardcopy of IEEE-754 out of a filing cabinet if needed.]

Significant digits are within the precision of the calculation.
Writing 1.230 indicates that the fourth digit is known to be zero.
Writing 1.23 outside a context of exact calculation indicates that the
fourth digit is unknown due to insufficient precision.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Floating point "g" format not stripping trailing zeros Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-12 16:46 -0700
  Re: Floating point "g" format not stripping trailing zeros Grant Edwards <invalid@invalid.invalid> - 2015-02-13 14:02 +0000
    Re: Floating point "g" format not stripping trailing zeros Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-13 09:56 -0700
      Re: Floating point "g" format not stripping trailing zeros Grant Edwards <invalid@invalid.invalid> - 2015-02-13 20:33 +0000
        Re: Floating point "g" format not stripping trailing zeros Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-13 14:01 -0700
        Re: Floating point "g" format not stripping trailing zeros Dave Angel <davea@davea.name> - 2015-02-13 16:15 -0500
          Re: Floating point "g" format not stripping trailing zeros Grant Edwards <invalid@invalid.invalid> - 2015-02-13 21:22 +0000
            Re: Floating point "g" format not stripping trailing zeros Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-13 14:40 -0700
            Re: Floating point "g" format not stripping trailing zeros Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-13 14:49 -0700

csiph-web