Skip to content

Commit 9265cca

Browse files
authored
Merge pull request micropython#6110 from tekktrik/doc/document-special-math-funcs
Add disclaimer about availability of math functions
2 parents faaf181 + ad502a9 commit 9265cca

File tree

1 file changed

+52
-13
lines changed

1 file changed

+52
-13
lines changed

shared-bindings/math/__init__.c

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -191,55 +191,82 @@ MATH_FUN_2(pow, pow)
191191
MATH_FUN_1(exp, exp)
192192
#if MICROPY_PY_MATH_SPECIAL_FUNCTIONS
193193
//| def expm1(x: float) -> float:
194-
//| """Return ``exp(x) - 1``."""
194+
//| """Return ``exp(x) - 1``.
195+
//|
196+
//| May not be available on some boards.
197+
//| """
195198
//| ...
196199
//|
197200
MATH_FUN_1(expm1, expm1)
198201

199202
//| def log2(x: float) -> float:
200-
//| """Return the base-2 logarithm of ``x``."""
203+
//| """Return the base-2 logarithm of ``x``.
204+
//|
205+
//| May not be available on some boards.
206+
//| """
201207
//| ...
202208
//|
203209
MATH_FUN_1_ERRCOND(log2, log2, (x <= (mp_float_t)0.0))
204210

205211
//| def log10(x: float) -> float:
206-
//| """Return the base-10 logarithm of ``x``."""
212+
//| """Return the base-10 logarithm of ``x``.
213+
//|
214+
//| May not be available on some boards.
215+
//| """
207216
//| ...
208217
//|
209218
MATH_FUN_1_ERRCOND(log10, log10, (x <= (mp_float_t)0.0))
210219

211220
//| def cosh(x: float) -> float:
212-
//| """Return the hyperbolic cosine of ``x``."""
221+
//| """Return the hyperbolic cosine of ``x``.
222+
//|
223+
//| May not be available on some boards.
224+
//| """
213225
//| ...
214226
//|
215227
MATH_FUN_1(cosh, cosh)
216228

217229
//| def sinh(x: float) -> float:
218-
//| """Return the hyperbolic sine of ``x``."""
230+
//| """Return the hyperbolic sine of ``x``.
231+
//|
232+
//| May not be available on some boards.
233+
//| """
219234
//| ...
220235
//|
221236
MATH_FUN_1(sinh, sinh)
222237

223238
//| def tanh(x: float) -> float:
224-
//| """Return the hyperbolic tangent of ``x``."""
239+
//| """Return the hyperbolic tangent of ``x``.
240+
//|
241+
//| May not be available on some boards.
242+
//| """
225243
//| ...
226244
//|
227245
MATH_FUN_1(tanh, tanh)
228246

229247
//| def acosh(x: float) -> float:
230-
//| """Return the inverse hyperbolic cosine of ``x``."""
248+
//| """Return the inverse hyperbolic cosine of ``x``.
249+
//|
250+
//| May not be available on some boards.
251+
//| """
231252
//| ...
232253
//|
233254
MATH_FUN_1(acosh, acosh)
234255

235256
//| def asinh(x: float) -> float:
236-
//| """Return the inverse hyperbolic sine of ``x``."""
257+
//| """Return the inverse hyperbolic sine of ``x``.
258+
//|
259+
//| May not be available on some boards.
260+
//| """
237261
//| ...
238262
//|
239263
MATH_FUN_1(asinh, asinh)
240264

241265
//| def atanh(x: float) -> float:
242-
//| """Return the inverse hyperbolic tangent of ``x``."""
266+
//| """Return the inverse hyperbolic tangent of ``x``.
267+
//|
268+
//| May not be available on some boards.
269+
//| """
243270
//| ...
244271
//|
245272
MATH_FUN_1(atanh, atanh)
@@ -281,25 +308,37 @@ MATH_FUN_2(ldexp, ldexp)
281308
#if MICROPY_PY_MATH_SPECIAL_FUNCTIONS
282309

283310
//| def erf(x: float) -> float:
284-
//| """Return the error function of ``x``."""
311+
//| """Return the error function of ``x``.
312+
//|
313+
//| May not be available on some boards.
314+
//| """
285315
//| ...
286316
//|
287317
MATH_FUN_1(erf, erf)
288318

289319
//| def erfc(x: float) -> float:
290-
//| """Return the complementary error function of ``x``."""
320+
//| """Return the complementary error function of ``x``.
321+
//|
322+
//| May not be available on some boards.
323+
//| """
291324
//| ...
292325
//|
293326
MATH_FUN_1(erfc, erfc)
294327

295328
//| def gamma(x: float) -> float:
296-
//| """Return the gamma function of ``x``."""
329+
//| """Return the gamma function of ``x``.
330+
//|
331+
//| May not be available on some boards.
332+
//| """
297333
//| ...
298334
//|
299335
MATH_FUN_1(gamma, tgamma)
300336

301337
//| def lgamma(x: float) -> float:
302-
//| """Return the natural logarithm of the gamma function of ``x``."""
338+
//| """Return the natural logarithm of the gamma function of ``x``.
339+
//|
340+
//| May not be available on some boards.
341+
//| """
303342
//| ...
304343
//|
305344
MATH_FUN_1(lgamma, lgamma)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy