Skip to content

Commit e678d52

Browse files
author
Release Manager
committed
gh-36053: cython-lint : add note about unused imports <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> removing some unused imports, following suggestions of cython-lint <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36053 Reported by: Frédéric Chapoton Reviewer(s): Frédéric Chapoton, Matthias Köppe
2 parents 6e19d23 + 193e644 commit e678d52

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

src/sage/libs/mpmath/ext_libmp.pyx

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Faster versions of some key functions in mpmath.libmp
44
from .ext_impl cimport *
55
from sage.libs.gmp.all cimport *
66

7+
# the next line is used by mpmath
78
from .ext_impl import exp_fixed, cos_sin_fixed, log_int_fixed
89

910
# Note: not thread-safe
@@ -12,6 +13,7 @@ cdef MPF tmp2
1213
MPF_init(&tmp1)
1314
MPF_init(&tmp2)
1415

16+
1517
def mpf_add(tuple x, tuple y, int prec=0, str rnd='d'):
1618
cdef MPopts opts
1719
MPF_set_tuple(&tmp1, x)
@@ -21,6 +23,7 @@ def mpf_add(tuple x, tuple y, int prec=0, str rnd='d'):
2123
MPF_add(&tmp1, &tmp1, &tmp2, opts)
2224
return MPF_to_tuple(&tmp1)
2325

26+
2427
def mpf_sub(tuple x, tuple y, int prec=0, str rnd='d'):
2528
cdef MPopts opts
2629
MPF_set_tuple(&tmp1, x)
@@ -30,6 +33,7 @@ def mpf_sub(tuple x, tuple y, int prec=0, str rnd='d'):
3033
MPF_sub(&tmp1, &tmp1, &tmp2, opts)
3134
return MPF_to_tuple(&tmp1)
3235

36+
3337
def mpf_mul(tuple x, tuple y, int prec=0, str rnd='d'):
3438
cdef MPopts opts
3539
MPF_set_tuple(&tmp1, x)
@@ -39,6 +43,7 @@ def mpf_mul(tuple x, tuple y, int prec=0, str rnd='d'):
3943
MPF_mul(&tmp1, &tmp1, &tmp2, opts)
4044
return MPF_to_tuple(&tmp1)
4145

46+
4247
def mpf_div(tuple x, tuple y, int prec, str rnd='d'):
4348
cdef MPopts opts
4449
MPF_set_tuple(&tmp1, x)
@@ -48,9 +53,10 @@ def mpf_div(tuple x, tuple y, int prec, str rnd='d'):
4853
MPF_div(&tmp1, &tmp1, &tmp2, opts)
4954
return MPF_to_tuple(&tmp1)
5055

56+
5157
def mpf_sqrt(tuple x, int prec, str rnd='d'):
5258
"""
53-
Computes sqrt(x) with mpf value tuples.
59+
Compute sqrt(x) with mpf value tuples.
5460
5561
EXAMPLES::
5662
@@ -59,7 +65,6 @@ def mpf_sqrt(tuple x, int prec, str rnd='d'):
5965
sage: y = mpf_sqrt(x, 53, 'n')
6066
sage: to_float(y)
6167
1.4142135623730951
62-
6368
"""
6469
if x[0]:
6570
import mpmath.libmp as libmp
@@ -71,9 +76,10 @@ def mpf_sqrt(tuple x, int prec, str rnd='d'):
7176
MPF_sqrt(&tmp1, &tmp1, opts)
7277
return MPF_to_tuple(&tmp1)
7378

79+
7480
def mpf_log(tuple x, int prec, str rnd='d'):
7581
"""
76-
Computes log(x) with mpf value tuples.
82+
Compute log(x) with mpf value tuples.
7783
7884
EXAMPLES::
7985
@@ -82,7 +88,6 @@ def mpf_log(tuple x, int prec, str rnd='d'):
8288
sage: y = mpf_log(x, 53, 'n')
8389
sage: to_float(y)
8490
0.6931471805599453
85-
8691
"""
8792
if x[0]:
8893
import mpmath.libmp as libmp
@@ -94,9 +99,10 @@ def mpf_log(tuple x, int prec, str rnd='d'):
9499
MPF_log(&tmp1, &tmp1, opts)
95100
return MPF_to_tuple(&tmp1)
96101

102+
97103
def mpf_exp(tuple x, int prec, str rnd='d'):
98104
"""
99-
Computes exp(x) with mpf value tuples.
105+
Compute exp(x) with mpf value tuples.
100106
101107
EXAMPLES::
102108
@@ -105,7 +111,6 @@ def mpf_exp(tuple x, int prec, str rnd='d'):
105111
sage: z = mpf_exp(x, 53, 'n')
106112
sage: to_float(z)
107113
7.38905609893065
108-
109114
"""
110115
cdef MPopts opts
111116
MPF_set_tuple(&tmp1, x)
@@ -114,9 +119,10 @@ def mpf_exp(tuple x, int prec, str rnd='d'):
114119
MPF_exp(&tmp1, &tmp1, opts)
115120
return MPF_to_tuple(&tmp1)
116121

122+
117123
def mpf_cos(tuple x, int prec, str rnd='d'):
118124
"""
119-
Computes cos(x) with mpf value tuples.
125+
Compute cos(x) with mpf value tuples.
120126
121127
EXAMPLES::
122128
@@ -125,7 +131,6 @@ def mpf_cos(tuple x, int prec, str rnd='d'):
125131
sage: y = mpf_cos(x, 53, 'n')
126132
sage: to_float(y)
127133
0.5403023058681398
128-
129134
"""
130135
cdef MPopts opts
131136
MPF_set_tuple(&tmp1, x)
@@ -134,9 +139,10 @@ def mpf_cos(tuple x, int prec, str rnd='d'):
134139
MPF_cos(&tmp1, &tmp1, opts)
135140
return MPF_to_tuple(&tmp1)
136141

142+
137143
def mpf_sin(tuple x, int prec, str rnd='d'):
138144
"""
139-
Computes sin(x) with mpf value tuples.
145+
Compute sin(x) with mpf value tuples.
140146
141147
EXAMPLES::
142148
@@ -145,7 +151,6 @@ def mpf_sin(tuple x, int prec, str rnd='d'):
145151
sage: y = mpf_sin(x, 53, 'n')
146152
sage: to_float(y)
147153
0.8414709848078965
148-
149154
"""
150155
cdef MPopts opts
151156
MPF_set_tuple(&tmp1, x)
@@ -154,9 +159,10 @@ def mpf_sin(tuple x, int prec, str rnd='d'):
154159
MPF_sin(&tmp1, &tmp1, opts)
155160
return MPF_to_tuple(&tmp1)
156161

162+
157163
def mpc_sqrt(tuple z, int prec, str rnd='d'):
158164
"""
159-
Computes sqrt(z) with mpc value tuples.
165+
Compute sqrt(z) with mpc value tuples.
160166
161167
EXAMPLES::
162168
@@ -176,9 +182,10 @@ def mpc_sqrt(tuple z, int prec, str rnd='d'):
176182
MPF_complex_sqrt(&tmp1, &tmp2, &tmp1, &tmp2, opts)
177183
return MPF_to_tuple(&tmp1), MPF_to_tuple(&tmp2)
178184

185+
179186
def mpc_exp(tuple z, int prec, str rnd='d'):
180187
"""
181-
Computes exp(z) with mpc value tuples.
188+
Compute exp(z) with mpc value tuples.
182189
183190
EXAMPLES::
184191
@@ -198,9 +205,10 @@ def mpc_exp(tuple z, int prec, str rnd='d'):
198205
MPF_complex_exp(&tmp1, &tmp2, &tmp1, &tmp2, opts)
199206
return MPF_to_tuple(&tmp1), MPF_to_tuple(&tmp2)
200207

208+
201209
def mpf_pow(tuple x, tuple y, int prec, str rnd='d'):
202210
"""
203-
Computes x ^ y with mpf value tuples.
211+
Compute x ^ y with mpf value tuples.
204212
205213
EXAMPLES::
206214

0 commit comments

Comments
 (0)