Greg Ewing and Jonathan Goble wrote

>> Also, Fraction(1) for the second case would be flat-out wrong.

> How? Raising something to the 2/3 power means squaring it and then taking
> the cube root of it. -1 squared is 1, and the cube root of 1 is 1. Or am I
> having a 2:30am brain fart?

Let's see. What about computing the Fraction(2, 4) power by first
squaring and then taking the fourth root. Let's start with (-16).
Square to get +256. And then the fourth root is +4. I've just followed
process Jonathan G suggested, without noticing that Fraction(2, 4) is
equal to Fraction(1, 2).

But Fraction(1, 2) is the square root. And -16 requires complex
numbers for its square root. The problem, I think, may not be doing
something sensible in any particular case. Rather, it could be doing
something sensible and coherent in all cases. A bit like trying to fit
a carpet that is cut to the wrong size for the room.

-- 
Jonathan
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to