Jonathan Goble wrote:
How? Raising something to the 2/3 power means squaring it and then taking the cube root of it.
On reflection, "wrong" is not quite accurate. A better word might be "surprising". (-1) ** (2/3) == 1 would imply that 1 ** (3/2) == -1. I suppose that could be considered true if you take the negative solution of the square root, but it seems a bit strange, and it's not what Python gives you for the result of 1 ** (3/2). If you want a solution that round-trips, you need complex numbers. That's what Python does when you use floats. Making Fractions do something different would make it inconsistent with floats. My calculator (which only does real floats) reports an error when trying to evaluate (-1) ** (2/3). -- Greg _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/