Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #62506
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'value,': 0.04; 'say,': 0.05; 'subject:Python': 0.06; '64-bit': 0.07; 'float': 0.07; '22,': 0.09; '32-bit': 0.09; 'badly': 0.09; 'integers': 0.09; 'latter': 0.09; 'subject:Why': 0.09; 'terms,': 0.09; 'throws': 0.09; 'works.': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'thread': 0.14; "wouldn't": 0.14; 'bit).': 0.16; 'choice).': 0.16; 'display,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'integers,': 0.16; 'integers.': 0.16; "languages'": 0.16; 'roy': 0.16; 'discussions': 0.16; 'wrote:': 0.18; '(but': 0.19; 'cc:addr:python.org': 0.22; 'load': 0.23; 'integer': 0.24; 'subject:like': 0.24; 'fine': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'tim': 0.29; 'dec': 0.30; 'relative': 0.30; 'message-id:@mail.gmail.com': 0.30; 'asked': 0.31; 'asks': 0.31; 'chase': 0.31; 'dropped': 0.31; "they'll": 0.31; 'another': 0.32; 'quite': 0.32; '(including': 0.33; 'sense': 0.34; 'basic': 0.35; 'offered': 0.35; 'something': 0.35; 'no,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'accuracy': 0.36; 'doing': 0.36; 'possible': 0.36; 'performance': 0.37; 'starting': 0.37; 'represent': 0.38; 'depends': 0.38; 'support,': 0.39; 'space': 0.40; 'easy': 0.60; 'truly': 0.60; 'most': 0.60; 'new': 0.61; 'numbers': 0.61; 'range': 0.61; "you're": 0.61; 'first': 0.61; 'offer': 0.62; 'offering': 0.63; 'more': 0.64; 'nobody': 0.68; 'smith': 0.68; 'default': 0.69; '500': 0.70; 'article': 0.77; '100': 0.79; 'ridiculously': 0.84; 'to:none': 0.92; 'this!': 0.93; '2013': 0.98 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=S84rQzInuJHvEuTQPDdb6AjJUcEG1tvMy6DoUcO5dbY=; b=U5NgyxO39QmitKsfW03o8CkUShcuT0fcdRrCerBuwXHyJjP0GFkRQfdIS7Ms5vacVZ PUz2tckXhC2jT9UOC/4f1aAMIoIzuH61vcTgRZtuVpItWXUkMGoBN7ePfSVmehU64YTr R9sgHDi+vXwwfibv/BfYPgy7gPyHDU4wMWFoBFcY3PoygmOBLjJbSBk6aXXNQEL7vnry uDHpnU402GlXYVufbNIrq6Meg0NRMAq3oBa6nROFnxUfCTt1GRpXdkgg/uIhItDxRS/t X3MyucvzsUYPmO6lBT+WPLiqj0SaXSmSF41LWQL2p2g12sexNzgK3yAPW7cxYsDUbMWW SaPA== |
| MIME-Version | 1.0 |
| X-Received | by 10.66.102.39 with SMTP id fl7mr16177274pab.43.1387652644388; Sat, 21 Dec 2013 11:04:04 -0800 (PST) |
| In-Reply-To | <roy-867FD6.10590021122013@news.panix.com> |
| References | <roy-666C26.09193920122013@news.panix.com> <mailman.4441.1387561812.18130.python-list@python.org> <bhjs20Fi7pU1@mid.individual.net> <mailman.4451.1387603576.18130.python-list@python.org> <bhl0glF7cd9U1@mid.individual.net> <l93pui$8gr$1@dont-email.me> <mailman.4472.1387638502.18130.python-list@python.org> <roy-867FD6.10590021122013@news.panix.com> |
| Date | Sun, 22 Dec 2013 06:04:04 +1100 |
| Subject | Re: Why Python is like C++ |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| 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.4479.1387652653.18130.python-list@python.org> (permalink) |
| Lines | 43 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1387652653 news.xs4all.nl 2892 [2001:888:2000:d::a6]:47229 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:62506 |
Show key headers only | View raw
On Sun, Dec 22, 2013 at 2:59 AM, Roy Smith <roy@panix.com> wrote: > In article <mailman.4472.1387638502.18130.python-list@python.org>, > Tim Chase <python.list@tim.thechases.com> wrote: > >> In know that my first BASIC, Applesoft BASIC had the 2-character >> names, and you had to load Integer Basic (with Ints in addition to the >> standard Floats used in the BASIC provided by the ROM, a strange >> choice). > > Why is it a strange choice? If you're only going to support a single > type of numeric value, floats make a lot more sense than ints. Floats > are a superset of integers. No, reals are a superset of integers, and are also a superset of floats. Whether a float can precisely represent every int in your pool depends on their relative sizes; in another thread we've just had complaints about fixed-size integers in C, but they do simplify discussions like this! With IEEE floating point, it's theoretically possible to represent any integer smaller than 2**M, where M is the size of the mantissa (including its leading 1 bit). In practical terms, that means your float has to take up twice as much space as an int would (a 64-bit float has a 53-bit mantissa, so it can represent 32-bit numbers - nobody actually asks for 53-bit integer support, but you do have it). I don't know about non-IEEE float systems, but they'll be doing something similar. Arbitrary precision throws a whole new spanner in the works. It's pretty easy to offer an arbitrary-precision integer type that guarantees accuracy down to the last digit. Offering a float type that can represent a ridiculous range of integers is problematic. I notice that Python offers the former and not the latter :) REXX offered configurable-precision numeric calculations, but performance dropped off badly as the precision rose. That is to say, it was fine for the default 9 digits, fine for 100 digits (but now you have to format numbers for display, or they'll be ugly), starting to get slow if you asked for 500 digits, and really quite ridiculously slow with NUMERIC DIGITS 10000. I wouldn't say that most languages' float type is truly a superset of int. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Why Python is like C++ Roy Smith <roy@panix.com> - 2013-12-20 09:19 -0500
Re: Why Python is like C++ Serhiy Storchaka <storchaka@gmail.com> - 2013-12-20 19:46 +0200
Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-21 10:44 +1300
Re: Why Python is like C++ Michael Torrie <torriem@gmail.com> - 2013-12-20 22:25 -0700
Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-21 21:06 +1300
Re: Why Python is like C++ Chris Angelico <rosuav@gmail.com> - 2013-12-21 19:17 +1100
Re: Why Python is like C++ Christian Gollwitzer <auriocus@gmx.de> - 2013-12-21 11:19 +0100
Re: Why Python is like C++ Tim Chase <tim@thechases.com> - 2013-12-21 08:52 -0600
Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-22 13:17 +1300
Re: Why Python is like C++ Tim Chase <python.list@tim.thechases.com> - 2013-12-21 08:43 -0600
Re: Why Python is like C++ Roy Smith <roy@panix.com> - 2013-12-21 10:59 -0500
Re: Why Python is like C++ Tim Chase <python.list@tim.thechases.com> - 2013-12-21 10:29 -0600
Re: Why Python is like C++ Chris Angelico <rosuav@gmail.com> - 2013-12-22 06:04 +1100
Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-22 13:27 +1300
Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-22 13:14 +1300
Re: Why Python is like C++ Michael Torrie <torriem@gmail.com> - 2013-12-21 08:46 -0700
Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-22 13:36 +1300
Re: Why Python is like C++ Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-21 05:34 +0000
Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-21 21:09 +1300
Re: Why Python is like C++ Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-21 08:22 +0000
Re: Why Python is like C++ Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-21 11:37 +0000
Re: Why Python is like C++ Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-21 12:12 +0000
Re: Why Python is like C++ Dan Stromberg <drsalists@gmail.com> - 2013-12-21 00:18 -0800
Re: Why Python is like C++ Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-21 11:51 +0000
Re: Why Python is like C++ Roy Smith <roy@panix.com> - 2013-12-21 10:10 -0500
Re: Why Python is like C++ Terry Reedy <tjreedy@udel.edu> - 2013-12-21 17:03 -0500
Re: Why Python is like C++ Roy Smith <roy@panix.com> - 2013-12-21 17:28 -0500
Re: Why Python is like C++ Terry Reedy <tjreedy@udel.edu> - 2013-12-21 19:20 -0500
Re: Why Python is like C++ Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-21 08:42 +0000
Re: Why Python is like C++ Gene Heskett <gheskett@wdtv.com> - 2013-12-21 14:05 -0500
csiph-web