Skip to content

Commit 27cfb5b

Browse files
committed
Make doctests compatible with PARI-2.10
1 parent 2827855 commit 27cfb5b

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

cypari2/gen.pyx

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -688,14 +688,6 @@ cdef class Gen(Gen_auto):
688688
def polred(self, *args, **kwds):
689689
r'''
690690
This function is :emphasis:`deprecated`, use :meth:`.polredbest` instead.
691-
692-
Tests:
693-
694-
>>> from cypari2 import Pari
695-
>>> pari = Pari()
696-
697-
>>> pari('x^4 + 8').polred(2)
698-
[1, x - 1; 1/2*x^2 + 1, x^2 - 2*x + 3; -1/2*x^2 + 1, x^2 - 2*x + 3; 1/2*x^2, x^2 + 2; 1/4*x^3, x^4 + 2]
699691
'''
700692
import warnings
701693
with warnings.catch_warnings():
@@ -2899,12 +2891,10 @@ cdef class Gen(Gen_auto):
28992891
>>> pari(1.0).sizeword() == (4 if bitness == '32' else 3)
29002892
True
29012893
2902-
>>> pari('x').sizeword()
2903-
9
2904-
>>> pari('x^20').sizeword()
2905-
66
2906-
>>> pari('[x, I]').sizeword()
2907-
20
2894+
>>> pari('x + 1').sizeword()
2895+
10
2896+
>>> pari('[x + 1, 1]').sizeword()
2897+
16
29082898
"""
29092899
return gsizeword(x.g)
29102900

@@ -4504,14 +4494,6 @@ cdef class Gen(Gen_auto):
45044494
Traceback (most recent call last):
45054495
...
45064496
PariError: incorrect type in boundfact (t_POL)
4507-
4508-
PARI doesn't have an algorithm for factoring multivariate
4509-
polynomials:
4510-
4511-
>>> pari('x^3 - y^3').factor()
4512-
Traceback (most recent call last):
4513-
...
4514-
PariError: sorry, factor for general polynomials is not yet implemented
45154497
"""
45164498
cdef GEN g
45174499
global factor_proven
@@ -4816,13 +4798,13 @@ cdef class Gen(Gen_auto):
48164798
>>> from cypari2 import Pari
48174799
>>> pari = Pari()
48184800
4819-
>>> pari('[1/2, 1.0*I]').debug()
4801+
>>> pari('[1/2, 1 + 1.0*I]').debug()
48204802
[&=...] VEC(lg=3):...
48214803
1st component = [&=...] FRAC(lg=3):...
48224804
num = [&=...] INT(lg=3):... (+,lgefint=3):...
48234805
den = [&=...] INT(lg=3):... (+,lgefint=3):...
48244806
2nd component = [&=...] COMPLEX(lg=3):...
4825-
real = [&=...] INT(lg=2):... (0,lgefint=2):...
4807+
real = [&=...] INT(lg=3):... (+,lgefint=3):...
48264808
imag = [&=...] REAL(lg=3):... (+,expo=0):...
48274809
"""
48284810
sig_on()

0 commit comments

Comments
 (0)