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

Jeroen Demeyer J.Demeyer at UGent.be
Thu Aug 30 05:31:52 EDT 2018


With gmpy2 (note that mpq=fractions, mpfr=floating-point reals):

 >>> from gmpy2 import mpq
 >>> mpq("1/1") ** mpq("2/3")
mpfr('1.0')
 >>> mpq("-1/1") ** mpq("2/3")
mpfr('nan')
 >>> mpq("0/1") ** mpq("2/3")
mpfr('0.0')



More information about the Python-ideas mailing list