Skip to content

Commit 9e7c41a

Browse files
committed
Fix setrand() doctests
1 parent 1a88bb4 commit 9e7c41a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

autogen/generator.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,18 +194,23 @@ def ellmodulareqn(self, long N, x=None, y=None):
194194
void setrand(GEN)
195195
def setrand(n):
196196
r'''
197-
Reseeds the random number generator using the seed :math:`n`. No value is
198-
returned. The seed is either a technical array output by :literal:`getrand`, or a
199-
small positive integer, used to generate deterministically a suitable state
200-
array. For instance, running a randomized computation starting by
201-
:literal:`setrand(1)` twice will generate the exact same output.
197+
Reseeds the random number generator...
202198
'''
203199
cdef GEN _n = n.g
204200
sig_on()
205201
setrand(_n)
206202
clear_stack()
207203
<BLANKLINE>
208-
...
204+
def setrand(self, n):
205+
r'''
206+
Reseeds the random number generator...
207+
'''
208+
n = objtogen(n)
209+
cdef GEN _n = (<Gen>n).g
210+
sig_on()
211+
setrand(_n)
212+
clear_stack()
213+
<BLANKLINE>
209214
>>> G.handle_pari_function("bernvec",
210215
... cname="bernvec", prototype="L",
211216
... help="bernvec(x): this routine is obsolete, use bernfrac repeatedly.",

0 commit comments

Comments
 (0)