[Fwd: Comment on PEP-0238]

Guido van Rossum guido at digicool.com
Sat Jul 7 20:18:02 CEST 2001


> However, I think that some details of the numerics also need to
> be clarified before you boldly go.  Specifically,
> 
>  - What about long division?  A float cannot capture all results.
>    Should it raise a Value/Range error?
>    Should the programmer be forced to use divmod?
>    Should it return a rational?  
>    I don't really like the last two choices and the first two choices
>    obviate much of the usefulness of longs.

We'll introduce a new operator or function (e.g. div(x, y)) for
integer division, which will work for ints and longs.  When / is used
and the result can't be expressed as a C double, we can choose between
yielding Infinity or raising OverflowError; I think probably the
latter although with two float arguments this currently returns Inf on
most platforms.

>    Perhaps Paul Dubois's kinds mechanism comes to the rescue?
>    He does have a trial implementation in numeric (though 
>    I am not in favor of seeing much of the current numeric 
>    integrated into the core)

I don't think this will help.

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-list mailing list