PEP0238 lament

John W. Baxter jwbaxter at spamcop.com
Sun Jul 22 22:59:36 EDT 2001


In article <mailman.995836120.7223.python-list at python.org>, Moshe Zadka
<moshez at zadka.site.co.il> wrote:

> > I agree.  It's turning an otherwise fairly strongly (but dynamically)
> > typed language on its head.  If I want type-changing operations, I'll do
> > them explicitly.
> 
> Be sure to tell math.cos that...it has been "silently" turning integers
> into floats for years.

Not really the same thing, because within the range of int (on most
machines so far), no information is lost (always assuming we mean
double when we say float, which we seem to).

Also unlikely, in that the argument is in radians, and 1 radian (or 1.0
radian) isn't a particularly interesting value (at least for the things
I do..."broad on the starboard quarter" would be my more typical
approximation, although it's perhaps a half point off).

By the way, in .../lib/module-math.html (I keep my own copy on my end
of my 56K frame connection), it is not stated whether the input to
sin() (and the others where it applies) is degrees or radians.  An
experiment is necessary, or a reference to my rapidly waning C
knowledge or a visit to the C standard (which I'd rather not do, for
reasons of marginal sanity).

>>> math.sin(1)
0.8414709848078965

is a conclusive experiment...which I had to run before making the "also
unlikely" claim.
  
  --John



More information about the Python-list mailing list