[Python-Dev] Revamping Python's Numeric Model
Guido van Rossum
Mon, 06 Nov 2000 17:16:29 -0500
> > 1/2 yielding 0.5 is innovative? Give me a break. Pascal did this.
> > Algol-60 did this. Fortran does this. And rational numbers are less
> > innovative?
> Small correction: Fortran does not -- 1/2 is 0 in Fortran (same as C99's
> new rules, int div always truncates).
I stand corrected -- the idea is only 40 years old, not 44. :-)
> So far as innovation goes, no choice on the table so far is innovative
> (neither mathematically nor in programming languages), so there's no basis
> for choosing there.
> Guido, *why* did ABC use rationals by default? Was that driven by usability
I assume that the use of rationals for exact numbers was driven by
usability studies -- like us, the ABC designers were tired of
explaining the vagaries of floating point to novices.
I remember that I pushed for using rationals for 1E1000 and 1E-1000,
probably out of a mistaken sense of consistency. I don't think I'm
responsible for 1.0 being exact -- in "The B Programmer's Handbook"
(CWI, 1985) 1.0 is exact and 1E10 is approximate. In "The ABC
Progammer's Handbook (Prentice Hall, 1990) these are all exact.
--Guido van Rossum (home page: http://www.python.org/~guido/)