@@ -79,108 +79,108 @@ STATIC NORETURN void math_error(void) {
79
79
#define log2 (x ) (log(x) * 1.442695040888963407354163704)
80
80
#endif
81
81
82
- //| e: Any = ...
82
+ //| e: float = ...
83
83
//| """base of the natural logarithm"""
84
84
//|
85
- //| pi: Any = ...
85
+ //| pi: float = ...
86
86
//| """the ratio of a circle's circumference to its diameter"""
87
87
//|
88
88
89
- //| def acos(x: Any ) -> Any :
89
+ //| def acos(x: float ) -> float :
90
90
//| """Return the inverse cosine of ``x``."""
91
91
//| ...
92
92
//|
93
- //| def asin(x: Any ) -> Any :
93
+ //| def asin(x: float ) -> float :
94
94
//| """Return the inverse sine of ``x``."""
95
95
//| ...
96
96
//|
97
- //| def atan(x: Any ) -> Any :
97
+ //| def atan(x: float ) -> float :
98
98
//| """Return the inverse tangent of ``x``."""
99
99
//| ...
100
100
//|
101
- //| def atan2(y: Any , x: Any ) -> Any :
101
+ //| def atan2(y: float , x: float ) -> float :
102
102
//| """Return the principal value of the inverse tangent of ``y/x``."""
103
103
//| ...
104
104
//|
105
- //| def ceil(x: Any ) -> Any :
105
+ //| def ceil(x: float ) -> int :
106
106
//| """Return an integer, being ``x`` rounded towards positive infinity."""
107
107
//| ...
108
108
//|
109
- //| def copysign(x: Any , y: Any ) -> Any :
109
+ //| def copysign(x: float , y: float ) -> float :
110
110
//| """Return ``x`` with the sign of ``y``."""
111
111
//| ...
112
112
//|
113
- //| def cos(x: Any ) -> Any :
113
+ //| def cos(x: float ) -> float :
114
114
//| """Return the cosine of ``x``."""
115
115
//| ...
116
116
//|
117
- //| def degrees(x: Any ) -> Any :
117
+ //| def degrees(x: float ) -> float :
118
118
//| """Return radians ``x`` converted to degrees."""
119
119
//| ...
120
120
//|
121
- //| def exp(x: Any ) -> Any :
121
+ //| def exp(x: float ) -> float :
122
122
//| """Return the exponential of ``x``."""
123
123
//| ...
124
124
//|
125
- //| def fabs(x: Any ) -> Any :
125
+ //| def fabs(x: float ) -> float :
126
126
//| """Return the absolute value of ``x``."""
127
127
//| ...
128
128
//|
129
- //| def floor(x: Any ) -> Any :
129
+ //| def floor(x: float ) -> float :
130
130
//| """Return an integer, being ``x`` rounded towards negative infinity."""
131
131
//| ...
132
132
//|
133
- //| def fmod(x: Any , y: Any ) -> Any :
133
+ //| def fmod(x: float , y: float ) -> int :
134
134
//| """Return the remainder of ``x/y``."""
135
135
//| ...
136
136
//|
137
- //| def frexp(x: Any ) -> Any :
137
+ //| def frexp(x: float ) -> Tuple[int, int] :
138
138
//| """Decomposes a floating-point number into its mantissa and exponent.
139
139
//| The returned value is the tuple ``(m, e)`` such that ``x == m * 2**e``
140
140
//| exactly. If ``x == 0`` then the function returns ``(0.0, 0)``, otherwise
141
141
//| the relation ``0.5 <= abs(m) < 1`` holds."""
142
142
//| ...
143
143
//|
144
- //| def isfinite(x: Any ) -> Any :
144
+ //| def isfinite(x: float ) -> bool :
145
145
//| """Return ``True`` if ``x`` is finite."""
146
146
//| ...
147
147
//|
148
- //| def isinf(x: Any ) -> Any :
148
+ //| def isinf(x: float ) -> bool :
149
149
//| """Return ``True`` if ``x`` is infinite."""
150
150
//| ...
151
151
//|
152
- //| def isnan(x: Any ) -> Any :
152
+ //| def isnan(x: float ) -> bool :
153
153
//| """Return ``True`` if ``x`` is not-a-number"""
154
154
//| ...
155
155
//|
156
- //| def ldexp(x: Any , exp: Any ) -> Any :
156
+ //| def ldexp(x: float , exp: float ) -> float :
157
157
//| """Return ``x * (2**exp)``."""
158
158
//| ...
159
159
//|
160
- //| def modf(x: Any ) -> Any :
160
+ //| def modf(x: float ) -> Tuple[float, float] :
161
161
//| """Return a tuple of two floats, being the fractional and integral parts of
162
162
//| ``x``. Both return values have the same sign as ``x``."""
163
163
//| ...
164
164
//|
165
- //| def pow(x: Any , y: Any ) -> Any :
165
+ //| def pow(x: float , y: float ) -> float :
166
166
//| """Returns ``x`` to the power of ``y``."""
167
167
//|
168
- //| def radians(x: Any ) -> Any :
168
+ //| def radians(x: float ) -> float :
169
169
//| """Return degrees ``x`` converted to radians."""
170
170
//|
171
- //| def sin(x: Any ) -> Any :
171
+ //| def sin(x: float ) -> float :
172
172
//| """Return the sine of ``x``."""
173
173
//| ...
174
174
//|
175
- //| def sqrt(x: Any ) -> Any :
175
+ //| def sqrt(x: float ) -> float :
176
176
//| """Returns the square root of ``x``."""
177
177
//| ...
178
178
//|
179
- //| def tan(x: Any ) -> Any :
179
+ //| def tan(x: float ) -> float :
180
180
//| """Return the tangent of ``x``."""
181
181
//| ...
182
182
//|
183
- //| def trunc(x: Any ) -> Any :
183
+ //| def trunc(x: float ) -> int :
184
184
//| """Return an integer, being ``x`` rounded towards 0."""
185
185
//| ...
186
186
//|
@@ -190,55 +190,55 @@ MATH_FUN_2(pow, pow)
190
190
191
191
MATH_FUN_1 (exp , exp )
192
192
#if MICROPY_PY_MATH_SPECIAL_FUNCTIONS
193
- //| def expm1(x) :
193
+ //| def expm1(x: float) -> float :
194
194
//| """Return ``exp(x) - 1``."""
195
195
//| ...
196
196
//|
197
197
MATH_FUN_1 (expm1 , expm1 )
198
198
199
- //| def log2(x) :
199
+ //| def log2(x: float) -> float :
200
200
//| """Return the base-2 logarithm of ``x``."""
201
201
//| ...
202
202
//|
203
203
MATH_FUN_1_ERRCOND (log2 , log2 , (x <= (mp_float_t )0.0 ))
204
204
205
- //| def log10(x) :
205
+ //| def log10(x: float) -> float :
206
206
//| """Return the base-10 logarithm of ``x``."""
207
207
//| ...
208
208
//|
209
209
MATH_FUN_1_ERRCOND (log10 , log10 , (x <= (mp_float_t )0.0 ))
210
210
211
- //| def cosh(x) :
211
+ //| def cosh(x: float) -> float :
212
212
//| """Return the hyperbolic cosine of ``x``."""
213
213
//| ...
214
214
//|
215
215
MATH_FUN_1 (cosh , cosh )
216
216
217
- //| def sinh(x) :
217
+ //| def sinh(x: float) -> float :
218
218
//| """Return the hyperbolic sine of ``x``."""
219
219
//| ...
220
220
//|
221
221
MATH_FUN_1 (sinh , sinh )
222
222
223
- //| def tanh(x) :
223
+ //| def tanh(x: float) -> float :
224
224
//| """Return the hyperbolic tangent of ``x``."""
225
225
//| ...
226
226
//|
227
227
MATH_FUN_1 (tanh , tanh )
228
228
229
- //| def acosh(x) :
229
+ //| def acosh(x: float) -> float :
230
230
//| """Return the inverse hyperbolic cosine of ``x``."""
231
231
//| ...
232
232
//|
233
233
MATH_FUN_1 (acosh , acosh )
234
234
235
- //| def asinh(x) :
235
+ //| def asinh(x: float) -> float :
236
236
//| """Return the inverse hyperbolic sine of ``x``."""
237
237
//| ...
238
238
//|
239
239
MATH_FUN_1 (asinh , asinh )
240
240
241
- //| def atanh(x) :
241
+ //| def atanh(x: float) -> float :
242
242
//| """Return the inverse hyperbolic tangent of ``x``."""
243
243
//| ...
244
244
//|
@@ -280,25 +280,25 @@ MATH_FUN_1_TO_INT(trunc, trunc)
280
280
MATH_FUN_2 (ldexp , ldexp )
281
281
#if MICROPY_PY_MATH_SPECIAL_FUNCTIONS
282
282
283
- //| def erf(x) :
283
+ //| def erf(x: float) -> float :
284
284
//| """Return the error function of ``x``."""
285
285
//| ...
286
286
//|
287
287
MATH_FUN_1 (erf , erf )
288
288
289
- //| def erfc(x) :
289
+ //| def erfc(x: float) -> float :
290
290
//| """Return the complementary error function of ``x``."""
291
291
//| ...
292
292
//|
293
293
MATH_FUN_1 (erfc , erfc )
294
294
295
- //| def gamma(x) :
295
+ //| def gamma(x: float) -> float :
296
296
//| """Return the gamma function of ``x``."""
297
297
//| ...
298
298
//|
299
299
MATH_FUN_1 (gamma , tgamma )
300
300
301
- //| def lgamma(x) :
301
+ //| def lgamma(x: float) -> float :
302
302
//| """Return the natural logarithm of the gamma function of ``x``."""
303
303
//| ...
304
304
//|
0 commit comments