Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
21808: fix some more .python() .sage()
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Jan 10, 2017
1 parent 79397fb commit 183588e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/sage/interfaces/gp.py
Expand Up @@ -908,7 +908,7 @@ def _sage_(self):
sage: gp(M).sage() == M
True
"""
return pari(str(self)).python()
return pari(str(self)).sage()

def is_string(self):
"""
Expand Down
22 changes: 11 additions & 11 deletions src/sage/rings/real_mpfr.pyx
Expand Up @@ -1465,15 +1465,15 @@ cdef class RealNumber(sage.structure.element.RingElement):
sage: rt2 = sqrt(pari('2.0'))
sage: rt2
1.41421356237310
sage: rt2.python()
sage: rt2.sage()
1.41421356237309505
sage: rt2.python().prec()
sage: rt2.sage().prec()
64
sage: pari(rt2.python()) == rt2
sage: pari(rt2.sage()) == rt2
True
sage: for i in range(100, 200):
....: assert(sqrt(pari(i)) == pari(sqrt(pari(i)).python()))
sage: (-3.1415)._pari_().python()
....: assert(sqrt(pari(i)) == pari(sqrt(pari(i)).sage()))
sage: (-3.1415)._pari_().sage()
-3.14150000000000000
"""
cdef int sgn
Expand Down Expand Up @@ -3064,15 +3064,15 @@ cdef class RealNumber(sage.structure.element.RingElement):
-1.23456700000000
sage: RR(2.0).sqrt()._pari_()
1.41421356237310
sage: RR(2.0).sqrt()._pari_().python()
sage: RR(2.0).sqrt()._pari_().sage()
1.41421356237309515
sage: RR(2.0).sqrt()._pari_().python().prec()
sage: RR(2.0).sqrt()._pari_().sage().prec()
64
sage: RealField(70)(pi)._pari_().python().prec()
sage: RealField(70)(pi)._pari_().sage().prec()
96 # 32-bit
128 # 64-bit
sage: for i in range(100, 200):
....: assert(RR(i).sqrt() == RR(i).sqrt()._pari_().python())
....: assert(RR(i).sqrt() == RR(i).sqrt()._pari_().sage())
TESTS:
Expand Down Expand Up @@ -5027,9 +5027,9 @@ cdef class RealNumber(sage.structure.element.RingElement):
sage: z = pari(2).zeta(precision=53); z
1.64493406684823
sage: pari(2).zeta(precision=128).python().prec()
sage: pari(2).zeta(precision=128).sage().prec()
128
sage: pari(2).zeta(precision=65).python().prec()
sage: pari(2).zeta(precision=65).sage().prec()
128 # 64-bit
96 # 32-bit
Expand Down

0 comments on commit 183588e

Please sign in to comment.