[Python-ideas] Fix some special cases in Fractions?
Jeroen Demeyer
J.Demeyer at UGent.be
Thu Aug 30 05:28:51 EDT 2018
On 2018-08-30 11:11, Jonathan Fine wrote:
> If anyone has time and ready access, it would help to know what
> https://www.sympy.org/en/index.html does with this.
It handles such powers symbolically, not actually returning a numerical
result:
>>> from sympy import Rational
>>> Rational(1,2) ** Rational(2,3)
2**(1/3)/2
>>> Rational(1,1) ** Rational(2,3)
1
>>> Rational(-1,1) ** Rational(2,3)
(-1)**(2/3)
>>> Rational(0,1) ** Rational(2,3)
0
More information about the Python-ideas
mailing list