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


Groups > comp.lang.python > #112011

Re: Float

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Ben Finney <ben+python@benfinney.id.au>
Newsgroups comp.lang.python
Subject Re: Float
Date Fri, 29 Jul 2016 20:25:29 +1000
Lines 28
Message-ID <mailman.20.1469787948.6033.python-list@python.org> (permalink)
References <da5a1bae-813f-4fef-a7b6-f67f258bcc85@googlegroups.com> <85bn1gpwpy.fsf@benfinney.id.au>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Trace news.uni-berlin.de 09/N+oK3QAzxnUMbEL++QgqiBKx4b6ndTp7zLwXYIvCQ==
Cancel-Lock sha1:o3Z2vX6s/0RcRtOkhIC9HvWA0ro=
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.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'bits': 0.07; 'compute': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'appropriate': 0.14; 'numbers;': 0.16; 'received:80.91.229.3': 0.16; 'received:io': 0.16; 'received:plane.gmane.org': 0.16; 'received:psf.io': 0.16; 'rights,': 0.16; 'substitute': 0.16; 'integer': 0.18; 'fraction': 0.22; 'decide': 0.23; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'not.': 0.27; 'values': 0.28; 'decimal': 0.29; 'url:wikipedia': 0.29; 'url:wiki': 0.30; 'maybe': 0.33; 'but': 0.36; 'there': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'support,': 0.37; 'whom': 0.37; 'someone': 0.38; 'represent': 0.38; 'means': 0.39; 'url:en': 0.39; 'to:addr:python.org': 0.40; 'your': 0.60; 'matter': 0.63; 'information': 0.63; 'rose': 0.72; '_o__)': 0.84; 'received:125': 0.84
X-Injected-Via-Gmane http://gmane.org/
X-Gmane-NNTP-Posting-Host jigong.madmonks.org
X-Public-Key-ID 0xAC128405
X-Public-Key-Fingerprint 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
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>
X-Mailman-Original-Message-ID <85bn1gpwpy.fsf@benfinney.id.au>
X-Mailman-Original-References <da5a1bae-813f-4fef-a7b6-f67f258bcc85@googlegroups.com>
Xref csiph.com comp.lang.python:112011

Show key headers only | View raw


Cai Gengyang <gengyangcai@gmail.com> writes:

> Can someone explain in layman's terms what "float" means ?

They are a compromise: in a known number of bits and with explict
very-fast hardware support, represent numbers at a large range of
scales. The compromise is that the values have limited precision for
representing those numbers.

<URL:https://en.wikipedia.org/wiki/Floating_point>

If you want exact representations of numbers, you don't want
floating-point numbers; you want Fraction or Decimal or integer etc.

If you just want to have fairly-good precision of fractional numbers, as
fast as your computer can compute them, then maybe the built-in
floating-point numbers are what you want.

There is no substitute for knowing the characteristics of floating-point
numbers, and using that information to decide when they are appropriate
and when they are not.

-- 
 \     “Books and opinions, no matter from whom they came, if they are |
  `\     in opposition to human rights, are nothing but dead letters.” |
_o__)                                                  —Ernestine Rose |
Ben Finney

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


Thread

Float Cai Gengyang <gengyangcai@gmail.com> - 2016-07-29 02:44 -0700
  Re: Float Lutz Horn <lutz.horn@posteo.de> - 2016-07-29 11:56 +0200
  Re: Float Ben Finney <ben+python@benfinney.id.au> - 2016-07-29 20:25 +1000
  Re: Float Steven D'Aprano <steve@pearwood.info> - 2016-07-30 00:26 +1000
    Re: Float Cai Gengyang <gengyangcai@gmail.com> - 2016-07-30 03:21 -0700
      Re: Float Steven D'Aprano <steve@pearwood.info> - 2016-07-30 20:34 +1000
        Re: Float Cai Gengyang <gengyangcai@gmail.com> - 2016-07-30 04:44 -0700
          Re: Float Chris Angelico <rosuav@gmail.com> - 2016-07-30 21:51 +1000
            Re: Float Rustom Mody <rustompmody@gmail.com> - 2016-07-30 20:20 -0700
              Re: Float Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-08-04 00:28 -0700
          Re: Float Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2016-07-30 12:03 -0400
          Re: Float eryk sun <eryksun@gmail.com> - 2016-07-30 18:19 +0000

csiph-web