[Python-ideas] Fix some special cases in Fractions?

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Aug 30 05:26:42 EDT 2018


Neil Girdhar wrote:
> we want branch continuity in the power.  
> After all, floating point values have some inaccuracy, and we wouldn't 
> want chaotic behavior, i.e., small changes to the power to have drastic 
> changes to the result.
> 
> This is not like Fraction where we know that x ** Fraction(1, 3) is a 
> genuine cube root, and so why not return the principal cube, which we 
> know to be real valued for real valued x?

Because that would be possible only for a few special combinations
of Fractions ** Fractions that happen to have rational solutions. All
the others would still have to return float or complex results,
which could then be discontinuous with the rational ones.

-- 
Greg


More information about the Python-ideas mailing list