[Numpy-discussion] Re: numpy, overflow, inf, ieee, and rich , comparison

Johann Hibschman johann at physics.berkeley.edu
Fri Oct 27 19:55:23 EDT 2000


Alex Martelli writes:

>> Is there any situation in which you would want -1/-3 = 0?

> For example, for any non-null integers a,b,c, we might
> like to have
>     a/b == (a*c)/(b*c)
> right?  After all, we can see algebraically that the factors
> of c in numerator and denominator simplify out...

Well, of course it doesn't make sense *algebraically*, since we're not
dealing with an *algebra* at all.  For that we'd need the rationals.
With integers, it's against the rules to play such tricks, in general,
just like dividing by 0 is a no-no.

<wink>

(On a more serious note, I still think the best thing to do would be
to borrow Scheme's number systems.  Inexact/exact, built-in rationals,
and special operators to do modular arithmetic.  Py 3k, I imagine.)

-- 
Johann Hibschman                           johann at physics.berkeley.edu



More information about the Python-list mailing list