Numeric Programming for Everybody

Don Dwiggins dwig at advancedmp.net
Wed Jun 6 12:48:20 EDT 2001


Steven D Majewski writes:
> The best way to cater to both the beginner and the specialist is to
> leave floating point entirely to the specialist. The problem is that,
> because computers were originally designed for specialists, they 
> happen to have been designed with fast specialized floating-point
> hardware, and absolutely no specialized rational arithmetic hardware. 

Unfortunately, even beginners (or occasional users) need to deal with
fractional values from time to time.  

Here's a strawman proposal: the "default" number system for the language
will be like that of Unix "bc": fixed point (the user must declare how many
fractional places), no limit on size.  Yes, of course it's inefficient, but
it's a good fit to the beginner's mental model.  The introductory
documentation will describe this system, and mention the others available,
and why one might want to use them.

Where speed and/or size is an issue, the more sophisticated programmer will
move to integer, rational, or floating point, as appropriate (and of course,
the documentation will include -- or point to -- descriptions of the
consequences of the choice).

-- 
Don Dwiggins                    "Solvitur Ambulando"
Advanced MP Technology
dwig at advancedmp.net





More information about the Python-list mailing list