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


Groups > comp.lang.python > #8502

Re: Significant figures calculation

Date 2011-06-27 08:04 -0400
From Dave Angel <davea@ieee.org>
Subject Re: Significant figures calculation
References (1 earlier) <4e04f793$0$29975$c3e8da3$5496439d@news.astraweb.com> <mailman.386.1308949143.1164.python-list@python.org> <iu5bgk01v0@news2.newsguy.com> <02a78be2-2c11-4068-81a3-cd8744e8eaf2@y30g2000vbu.googlegroups.com> <BANLkTi=GXp+k2XEk9mdhYwu1523Y0DAutA@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.445.1309176278.1164.python-list@python.org> (permalink)

Show all headers | View raw


(You top-posted your reply, instead of writing your response following 
the part you were quoting)

On 01/-10/-28163 02:59 PM, Lalitha Prasad K wrote:
> In numerical analysis there is this concept of machine zero, which is
> computed like this:
>
> e=1.0
> while 1.0+e>  1.0:
>      e=e/2.0
> print e
>
> The number e will give you the precision of floating point numbers.
>
> Lalitha Prasad
>

That particular algorithm is designed for binary floating point. The OP 
was asking about Decimal instances.  So you'd want to divide by 10.0 
each time.  And of course you'd want to do it with Decimal objects.
> On Sun, Jun 26, 2011 at 9:05 PM, Harold<dadapapa@googlemail.com>  wrote:
>
>>>> I'm curious.  Is there a way to get the number of significant digits
>>>> for a particular Decimal instance?

DaveA

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


Thread

Significant figures calculation Harold <dadapapa@googlemail.com> - 2011-06-24 13:05 -0700
  Re: Significant figures calculation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-24 20:46 +0000
    Re: Significant figures calculation Jerry Hill <malaclypse2@gmail.com> - 2011-06-24 16:58 -0400
      Re: Significant figures calculation steve+comp.lang.python@pearwood.info - 2011-06-25 10:31 +1000
      Re: Significant figures calculation Chris Torek <nospam@torek.net> - 2011-06-25 19:04 +0000
        Re: Significant figures calculation Harold <dadapapa@googlemail.com> - 2011-06-26 08:35 -0700
          Re: Significant figures calculation Dave Angel <davea@ieee.org> - 2011-06-27 08:04 -0400
        Re: Significant figures calculation Harold <dadapapa@googlemail.com> - 2011-06-27 06:40 -0700
          Re: Significant figures calculation Ethan Furman <ethan@stoneleaf.us> - 2011-06-27 13:53 -0700
            Re: Significant figures calculation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-28 12:56 +1000
              Re: Significant figures calculation Chris Angelico <rosuav@gmail.com> - 2011-06-28 13:16 +1000
                Re: Significant figures calculation Erik Max Francis <max@alcyone.com> - 2011-06-27 20:45 -0700
                Re: Significant figures calculation Mel <mwilson@the-wire.com> - 2011-06-28 07:47 -0400
                Re: Significant figures calculation Chris Angelico <rosuav@gmail.com> - 2011-06-28 21:57 +1000
                Re: Significant figures calculation Erik Max Francis <max@alcyone.com> - 2011-06-28 11:54 -0700
                Re: Significant figures calculation Mel <mwilson@the-wire.com> - 2011-06-28 16:47 -0400
                Re: Significant figures calculation Erik Max Francis <max@alcyone.com> - 2011-06-28 14:01 -0700
                Re: Significant figures calculation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-28 18:35 +1000
                Re: Significant figures calculation Erik Max Francis <max@alcyone.com> - 2011-06-28 11:59 -0700
              Re: Significant figures calculation Erik Max Francis <max@alcyone.com> - 2011-06-27 20:49 -0700
          Re: Significant figures calculation Ethan Furman <ethan@stoneleaf.us> - 2011-06-27 15:58 -0700
    Re: Significant figures calculation Harold <dadapapa@googlemail.com> - 2011-06-24 18:50 -0700

csiph-web