@@ -3849,7 +3849,11 @@ cdef class Gen(Gen_base):
3849
3849
>>> f(3) == f.eval(3)
3850
3850
True
3851
3851
3852
- Evaluating power series:
3852
+ >>> f = pari('Mod(x^2 + x + 1, 3)')
3853
+ >>> f(2)
3854
+ Mod(1, 3)
3855
+
3856
+ Evaluating a power series:
3853
3857
3854
3858
>>> f = pari('1 + x + x^3 + O(x^7)')
3855
3859
>>> f(2*pari('y')**2)
@@ -3952,25 +3956,6 @@ cdef class Gen(Gen_base):
3952
3956
[x^2 + 1, [0, 1], -4, 1, [Mat([1, 0.E-38 + 1.00000000000000*I]), [1, 1.00000000000000; 1, -1.00000000000000], [1, 1; 1, -1], [2, 0; 0, -2], [2, 0; 0, 2], [1, 0; 0, -1], [1, [0, -1; 1, 0]], [2]], [0.E-38 + 1.00000000000000*I], [1, x], [1, 0; 0, 1], [1, 0, 0, -1; 0, 1, 1, 0]]
3953
3957
>>> nf(x='y')
3954
3958
[y^2 + 1, [0, 1], -4, 1, [Mat([1, 0.E-38 + 1.00000000000000*I]), [1, 1.00000000000000; 1, -1.00000000000000], [1, 1; 1, -1], [2, 0; 0, -2], [2, 0; 0, 2], [1, 0; 0, -1], [1, [0, -1; 1, 0]], [2]], [0.E-38 + 1.00000000000000*I], [1, y], [1, 0; 0, 1], [1, 0, 0, -1; 0, 1, 1, 0]]
3955
- """
3956
- return self (* args, ** kwds)
3957
-
3958
- def __call__ (self , *args , **kwds ):
3959
- """
3960
- Evaluate ``self`` with the given arguments.
3961
-
3962
- This has the same effect as :meth:`eval`.
3963
-
3964
- Examples:
3965
-
3966
- >>> from cypari2 import Pari
3967
- >>> pari = Pari()
3968
-
3969
- >>> f = pari('Mod(x^2 + x + 1, 3)')
3970
- >>> f.type()
3971
- 't_POL'
3972
- >>> f(2)
3973
- Mod(1, 3)
3974
3959
3975
3960
Tests:
3976
3961
@@ -3998,6 +3983,12 @@ cdef class Gen(Gen_base):
3998
3983
...
3999
3984
TypeError: cannot evaluate PARI t_INT using unnamed arguments
4000
3985
"""
3986
+ return self (* args, ** kwds)
3987
+
3988
+ def __call__ (self , *args , **kwds ):
3989
+ """
3990
+ Evaluate ``self`` with the given arguments. See ``eval``.
3991
+ """
4001
3992
cdef long t = typ(self .g)
4002
3993
cdef Gen t0
4003
3994
cdef GEN result
0 commit comments