Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'value,': 0.04; 'subject:Python': 0.06; 'javascript,': 0.07; 'subject:Why': 0.09; 'programs.': 0.14; '*should*': 0.16; '-tkc': 0.16; '8-bit': 0.16; ':-/': 0.16; 'anyone?': 0.16; 'choice).': 0.16; 'exponent': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'hardware.': 0.16; 'integers.': 0.16; 'manifest': 0.16; 'notably': 0.16; 'processor,': 0.16; 'roy': 0.16; 'wrote:': 0.18; 'load': 0.23; 'integer': 0.24; 'mathematical': 0.24; 'subject:like': 0.24; 'math': 0.24; 'equivalent': 0.26; 'header:In-Reply-To:1': 0.27; '[1]': 0.29; 'software,': 0.31; 'url:wiki': 0.31; 'faster,': 0.31; 'url:wikipedia': 0.31; 'cases': 0.33; 'sense': 0.34; 'basic': 0.35; 'equal': 0.35; 'but': 0.35; 'accuracy': 0.36; 'charset:us- ascii': 0.36; 'url:org': 0.36; 'apple': 0.38; 'to:addr:python- list': 0.38; 'rather': 0.38; 'explain': 0.39; 'itself': 0.39; 'to:addr:python.org': 0.39; 'even': 0.60; "you're": 0.61; 'first': 0.61; 'choose': 0.64; 'more': 0.64; 'smith': 0.68; '(according': 0.84; 'received:50.22': 0.84; 'wanting': 0.93 Date: Sat, 21 Dec 2013 10:29:39 -0600 From: Tim Chase To: python-list@python.org Subject: Re: Why Python is like C++ In-Reply-To: References: X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387643312 news.xs4all.nl 2949 [2001:888:2000:d::a6]:50810 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62500 On 2013-12-21 10:59, Roy Smith 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. > > Javascript, anyone? It's one thing when JS uses bajillion-bit precision on the floats. With an 8-bit processor, the accuracy was wanting (according to Wikipedia[1], single-precision with 8-bit exponent & 31-bit significand), so you'd often hit cases where INT1 + INT2 *should* equal INT3 + INT4, but because of floating-point errors, they wouldn't. It's maddening to have the mathematical equivalent of 2 + 4 != 1 + 5 manifest itself in your programs. And even harder to explain to a middle-schooler that I was at the time. :-/ Also, one of the main reasons to choose INTEGER BASIC on the Apple was that was notably faster, since FP math was managed in software, rather than in dedicated FP hardware. -tkc [1] http://en.wikipedia.org/wiki/Applesoft_basic#Background