Révision 162 pobysoPythonSage/src/sageMpfr.spyx
sageMpfr.spyx (revision 162) | ||
---|---|---|
19 | 19 |
cdef mp_rnd_t MPFR_RNDN "MPFR_RNDN" |
20 | 20 |
cdef mpfr_prec_t mpfr_min_prec(mpfr_t x) |
21 | 21 |
|
22 |
cpdef unsigned long int deref(unsigned long int p, int index): |
|
23 |
return((<unsigned long int*>p)[index]) |
|
24 |
|
|
22 | 25 |
cpdef unsigned long int get_interval_value(RealIntervalFieldElement x): |
23 | 26 |
""" |
24 | 27 |
Get the address of the value of a RealIntervalField Element. |
... | ... | |
115 | 118 |
|
116 | 119 |
# |
117 | 120 |
|
118 |
cpdef cmp_rn_value(RealNumber x, RealNumber y): |
|
119 |
""" |
|
120 |
Compare two RN with the mpfr_cmp function |
|
121 |
""" |
|
122 |
return(mpfr_cmp(x.value, y.value)) |
|
123 |
|
|
124 |
cpdef cmp_interval_value(RealIntervalFieldElement x, |
|
121 |
cpdef cmp_interval_values(RealIntervalFieldElement x, |
|
125 | 122 |
RealIntervalFieldElement y): |
126 | 123 |
""" |
127 | 124 |
Compare two intervals with the mpfi_cmp function |
128 | 125 |
""" |
129 | 126 |
return(mpfi_cmp(x.value, y.value)) |
130 | 127 |
|
128 |
cpdef cmp_rn_values(RealNumber x, RealNumber y): |
|
129 |
""" |
|
130 |
Compare two RN with the mpfr_cmp function |
|
131 |
""" |
|
132 |
return(mpfr_cmp(x.value, y.value)) |
|
133 |
|
|
131 | 134 |
# Do not use this function! |
132 | 135 |
# It changes the precision of the instance behind the curtain, but precision is |
133 | 136 |
# class attribute. If the precision is increased, memory space is wasted and |
Formats disponibles : Unified diff