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


Groups > comp.lang.python > #62500

Re: Why Python is like C++

Date 2013-12-21 10:29 -0600
From Tim Chase <python.list@tim.thechases.com>
Subject Re: Why Python is like C++
References (3 earlier) <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>
Newsgroups comp.lang.python
Message-ID <mailman.4474.1387643312.18130.python-list@python.org> (permalink)

Show all headers | View raw


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


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


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