1
1
r """
2
+ Tools for creation of `p`-adic elements
3
+
2
4
The functions in this file are used in creating new `p`-adic elements.
3
5
4
6
When creating a `p`-adic element, the user can specify that the absolute
@@ -49,7 +51,7 @@ cdef Rational rat_temp = PY_NEW(Rational)
49
51
50
52
cdef long get_ordp(x, PowComputer_class prime_pow) except ? - 10000 :
51
53
"""
52
- This function determines the valuation of the `p`-adic element
54
+ Determine the valuation of the `p`-adic element
53
55
that will result from the given data ``x``.
54
56
55
57
Note that the valuation can differ depending on the ring: if the
@@ -160,7 +162,7 @@ cdef long get_ordp(x, PowComputer_class prime_pow) except? -10000:
160
162
161
163
cdef long get_preccap(x, PowComputer_class prime_pow) except ? - 10000 :
162
164
"""
163
- This function determines the maximum absolute precision possible
165
+ Determine the maximum absolute precision possible
164
166
for an element created from the given data ``x``.
165
167
166
168
Note that the valuation can differ depending on the ring: if the
@@ -231,7 +233,7 @@ cdef long get_preccap(x, PowComputer_class prime_pow) except? -10000:
231
233
232
234
cdef long comb_prec(iprec, long prec) except ? - 10000 :
233
235
"""
234
- This function returns the minimum of iprec and prec.
236
+ Return the minimum of `` iprec`` and `` prec`` .
235
237
236
238
INPUT:
237
239
@@ -255,7 +257,7 @@ cdef long comb_prec(iprec, long prec) except? -10000:
255
257
256
258
cdef int _process_args_and_kwds(long * aprec, long * rprec, args, kwds, bint absolute, PowComputer_class prime_pow) except - 1 :
257
259
"""
258
- This function obtains values for absprec and relprec from a
260
+ Obtain values for `` absprec`` and `` relprec`` from a
259
261
combination of positional and keyword arguments.
260
262
261
263
When creating a `p`-adic element, the user can pass in two arguments: ``absprec`` and ``relprec``.
@@ -332,7 +334,7 @@ cdef inline long cconv_mpq_t_shared(mpz_t out, mpq_t x, long prec, bint absolute
332
334
333
335
OUTPUT:
334
336
335
- - If ``absolute`` is False then returns the valuation that was
337
+ - If ``absolute`` is `` False`` then returns the valuation that was
336
338
extracted (``maxordp`` when `x = 0`).
337
339
"""
338
340
cdef long numval, denval
@@ -364,6 +366,8 @@ cdef inline int cconv_mpq_t_out_shared(mpq_t out, mpz_t x, long valshift, long p
364
366
"""
365
367
Convert the underlying `p`-adic element into a rational.
366
368
369
+ INPUT:
370
+
367
371
- ``out`` -- gives a rational approximating the input. Currently uses
368
372
rational reconstruction but may change in the future to use a more naive
369
373
method
@@ -447,11 +451,11 @@ cdef inline int cconv_shared(mpz_t out, x, long prec, long valshift, PowComputer
447
451
else :
448
452
raise NotImplementedError
449
453
else :
450
- raise NotImplementedError (" No conversion defined for %s which is a %s in %s " % (x,type (x),x.parent() if hasattr (x," parent" ) else " no parent" ))
454
+ raise NotImplementedError (" No conversion defined for %s which is a %s in %s " % (x, type (x), x.parent() if hasattr (x, " parent" ) else " no parent" ))
451
455
452
456
cdef inline long cconv_mpz_t_shared(mpz_t out, mpz_t x, long prec, bint absolute, PowComputer_class prime_pow) except - 2 :
453
457
"""
454
- A fast pathway for conversion of integers that doesn't require
458
+ A fast pathway for conversion of integers that does not require
455
459
precomputation of the valuation.
456
460
457
461
INPUT:
@@ -485,6 +489,8 @@ cdef inline int cconv_mpz_t_out_shared(mpz_t out, mpz_t x, long valshift, long p
485
489
"""
486
490
Convert the underlying `p`-adic element into an integer if possible.
487
491
492
+ INPUT:
493
+
488
494
- ``out`` -- stores the resulting integer as an integer between 0
489
495
and `p^{prec + valshift}`
490
496
- ``x`` -- an ``mpz_t`` giving the underlying `p`-adic element
0 commit comments