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


Groups > comp.lang.python > #29676

Re: Exact integer-valued floats

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!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.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'bits': 0.07; 'commonly': 0.09; 'correct,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sep': 0.09; 'encoding': 0.15; '8-bit': 0.16; 'digits.': 0.16; 'ignores': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'integer': 0.17; 'tests': 0.18; 'bit': 0.21; 'affected': 0.22; 'runs': 0.22; 'somewhere': 0.24; 'possibility': 0.27; 'question': 0.27; 'header:X-Complaints- To:1': 0.28; "d'aprano": 0.29; 'decimal': 0.29; 'implied': 0.29; 'represented': 0.29; 'steven': 0.29; 'could': 0.32; 'shift': 0.33; 'url:home': 0.33; 'to:addr:python-list': 0.33; 'largest': 0.35; 'machines': 0.35; 'something': 0.35; 'received:org': 0.36; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'some': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'subject:-': 0.40; 'header:Received:5': 0.40; 'remove': 0.61; 'leading': 0.61; 'between': 0.63; 'more': 0.63; 'power': 0.74; 'inclusive': 0.84; 'dennis': 0.91; 'received:108': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Exact integer-valued floats
Date Fri, 21 Sep 2012 16:26:26 -0400
Organization > Bestiaria Support Staff <
References <505ca3e9$0$29981$c3e8da3$5496439d@news.astraweb.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 108.79.219.15
X-Newsreader Forte Agent 3.3/32.846
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1036.1348259186.27098.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1348259186 news.xs4all.nl 6934 [2001:888:2000:d::a6]:38899
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:29676

Show key headers only | View raw


On 21 Sep 2012 17:29:13 GMT, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> declaimed the following in
gmane.comp.python.general:

> 
> The question is, what is the largest integer number N such that every 
> whole number between -N and N inclusive can be represented as a float?
>
	Single precision commonly has 7 significant (decimal) digits. Double
precision runs somewhere between 13 and 15 (decimal) significant digits 

> If my tests are correct, that value is 9007199254740992.0 = 2**53.
>

	For an encoding of a double precision using one sign bit and an
8-bit exponent, you have 53 bits available for the mantissa. This
ignores the possibility of an implied msb in the mantissa (encodings
which normalize to put the leading 1-bit at the msb can on some machines
remove that 1-bit and shift the mantissa one more place; effectively
giving a 54-bit mantissa). Something like an old XDS Sigma-6 used
non-binary exponents (exponent was in power of 16 <> 2^4) and used
"non-normalized" mantissa -- the mantissa could have up to three leading
0-bits); this affected the decimal significance...


-- 
	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

Exact integer-valued floats Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-21 17:29 +0000
  Re: Exact integer-valued floats Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-21 12:13 -0600
  Re: Exact integer-valued floats Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2012-09-21 22:47 +0300
  Re: Exact integer-valued floats Nobody <nobody@nowhere.com> - 2012-09-21 20:59 +0100
  Re: Exact integer-valued floats Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-21 16:26 -0400
    Re: Exact integer-valued floats Hans Mulder <hansmu@xs4all.nl> - 2012-09-21 23:04 +0200
      Re: Exact integer-valued floats Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-21 20:54 -0400
  Re: Exact integer-valued floats Alister <alister.ware@ntlworld.com> - 2012-09-21 21:14 +0000
  Re: Exact integer-valued floats Paul Rubin <no.email@nospam.invalid> - 2012-09-21 15:23 -0700
    Re: Exact integer-valued floats Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-22 01:36 +0000
      Re: Exact integer-valued floats Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-22 01:01 -0400
        Re: Exact integer-valued floats Tim Roberts <timr@probo.com> - 2012-09-22 14:05 -0700
          Re: Exact integer-valued floats Dave Angel <d@davea.name> - 2012-09-22 19:06 -0400
            Re: Exact integer-valued floats Hans Mulder <hansmu@xs4all.nl> - 2012-09-23 09:45 +0200
          Re: Exact integer-valued floats wrw@mac.com - 2012-09-24 11:29 -0400
    Re: Exact integer-valued floats Nobody <nobody@nowhere.com> - 2012-09-22 11:19 +0100

csiph-web