[Edu-sig] Exponentiation should float

Ka-Ping Yee ping@lfw.org
Tue, 15 Feb 2000 13:34:58 -0600 (CST)


On Tue, 15 Feb 2000, Bruce Sherwood wrote:
> > ro=(8*pi*h*c)/(l**5)*(1/(exp(h*c/(l*k*T))-1))
> > 
> > Anyway, this produces a "OverflowError: integer pow()" which can be quite
> > misleading when there is no pow() on the line (** instead). 
> 
> Just as division should normally trigger a floating-point operation, so
> also exponentiation should trigger a floating-point operation. This
> shouldn't be an error.

It doesn't have to go to floating-point because the answer can
clearly be expressed as a whole number when the arguments are
whole numbers.  I think a better answer would be for it to go
automatically to long integer.  (There has been some discussion
recently on the developer's list about unifying integers and
long integers so that such promotion and demotion happens behind
the scenes, and no one needs to ever worry about that pesky "L"
suffix again.  I think this would be very nice.)


-- ?!ng