Source
Edit
Lib/math
Wrapper around Lib/n_math, and raises exceptions when math error occurs as CPython behaves.
func cbrt[F: SomeFloat](x: F): F
-
Admonition:
since Python 3.11
Example:
template chk =
assert cbrt(-1.0) == -1.0
chk()
static: chk()
Source
Edit
func comb(n, k: int): int {....raises: [ValueError], tags: [], forbids: [].}
-
Source
Edit
func expm1[F: SomeFloat](x: F): F
-
Admonition:
since Python 3.11
Source
Edit
func fma[F: SomeFloat](x, y, z: F): F
-
Admonition:
since Python 3.13
Source
Edit
func nextafter[F: SomeFloat](x, y: F; steps: int | uint64): F
-
Admonition:
since Python 3.12
Source
Edit
func perm(n, k: int): int {....raises: [ValueError], tags: [], forbids: [].}
-
Source
Edit
func perm(n: int): int {....raises: [ValueError], tags: [], forbids: [].}
-
Source
Edit
func remainder[F: SomeFloat](x, y: F): F
-
Source
Edit
func ulp[F: SomeFloat](x: F): F
-
Admonition:
since Python 3.9
Source
Edit
template dist[T](p, q: openArray[T]): float
-
Admonition:
since Python 3.8
Source
Edit
template sumprod[T](p, q: openArray[T]): float
-
Admonition:
since Python 3.12
Source
Edit
nan, inf, pi, tau, e, ceil, floor, fsum, trunc, frexp, frexp, modf, hypot, hypot, degrees, radians, isfinite, isinf, isclose, prod, gcd, gcd, lcm, lcm