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


Groups > comp.lang.python > #59930

Re: Setting longer default decimal precision

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder3.xlned.com!news.astraweb.com!border2.a.newsrouter.astraweb.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; '(at': 0.04; 'bits': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'default)': 0.16; 'digits.': 0.16; 'message-id:@4ax.com': 0.16; 'processors': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:> 50': 0.16; 'subject:default': 0.16; 'truncate': 0.16; 'seems': 0.21; '>>>': 0.22; 'print': 0.22; 'url:home': 0.24; 'math': 0.24; 'mon,': 0.24; 'least': 0.26; 'supported': 0.26; 'header:X-Complaints-To:1': 0.27; 'point': 0.28; 'decimal': 0.31; 'file': 0.32; "can't": 0.35; 'but': 0.35; 'skip:> 10': 0.36; 'charset:us-ascii': 0.36; 'example,': 0.37; 'received:76': 0.38; 'machines': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'most': 0.60; 'hardware': 0.61; 'back': 0.62; 'real': 0.63; 'default': 0.69; 'limit': 0.70; 'subject:Setting': 0.96; '2013': 0.98
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Setting longer default decimal precision
Date Mon, 18 Nov 2013 20:29:43 -0500
Organization IISS Elusive Unicorn
References <l6d7c7$402$1@speranza.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host adsl-76-249-29-210.dsl.klmzmi.sbcglobal.net
X-Newsreader Forte Agent 6.00/32.1186
X-No-Archive YES
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.2874.1384824591.18130.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1384824591 news.xs4all.nl 15950 [2001:888:2000:d::a6]:48348
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:59930

Show key headers only | View raw


On Mon, 18 Nov 2013 14:14:33 +0000, "Kay Y. Jheallee" <nospam@use.net>
declaimed the following:

>Using 1/3 as an example,
>
> >>> 1./3
>0.3333333333333333
> >>> print "%.50f" % (1./3)
>0.33333333333333331482961625624739099293947219848633
> >>> print "%.50f" % (10./3)
>3.33333333333333348136306995002087205648422241210938
> >>> print "%.50f" % (100./3)
>33.33333333333333570180911920033395290374755859375000
>
>which seems to mean real (at least default) decimal precision

	The default double precision FLOATING POINT is limited to ~15
significant digits. That's a hardware limit for double on most machines
(64-bits). Most floating point processors may use 80 bits internally, but
truncate back down on output.

	Python has supported a DECIMAL package for some years, but math with
that package will be slower as it can't go through the FPU.

Check the help file for your installation, look for decimal


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

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


Thread

Setting longer default decimal precision "Kay Y. Jheallee" <nospam@use.net> - 2013-11-18 14:14 +0000
  Re: Setting longer default decimal precision Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-18 14:43 +0000
  Re: Setting longer default decimal precision Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-11-18 20:29 -0500
  Re: Setting longer default decimal precision Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-11-20 14:02 +0000
    Re: Setting longer default decimal precision Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2013-11-20 14:40 +0000
    Re: Setting longer default decimal precision "Kay Y. Jheallee" <nospam@use.net> - 2013-11-20 19:34 +0000
      Re: Setting longer default decimal precision Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-11-20 19:59 +0000
      Re: Setting longer default decimal precision Tim Golden <mail@timgolden.me.uk> - 2013-11-20 20:04 +0000
      Re: Setting longer default decimal precision Tim Golden <mail@timgolden.me.uk> - 2013-11-20 20:24 +0000
      Re: Setting longer default decimal precision Larry Hudson <orgnut@yahoo.com> - 2013-11-20 23:04 -0800

csiph-web