0% found this document useful (0 votes)
9 views1 page

public documents 9

This module provides access to mathematical functions defined by the C standard, excluding support for complex numbers. It includes number-theoretic functions such as combinations, factorials, and greatest common divisors, as well as floating point arithmetic functions like ceiling, floor, and absolute value. All functions return float values unless stated otherwise.

Uploaded by

tamoyskitv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

public documents 9

This module provides access to mathematical functions defined by the C standard, excluding support for complex numbers. It includes number-theoretic functions such as combinations, factorials, and greatest common divisors, as well as floating point arithmetic functions like ceiling, floor, and absolute value. All functions return float values unless stated otherwise.

Uploaded by

tamoyskitv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

This module provides access to the mathematical functions defined by the C standard.

These functions cannot be used with complex numbers; use the functions of the same
name from the cmath module if you require support for complex numbers. The
distinction between functions which support complex numbers and those which don’t is
made since most users do not want to learn quite as much mathematics as required to
understand complex numbers. Receiving an exception instead of a complex result allows
earlier detection of the unexpected complex number used as a parameter, so that the
programmer can determine how and why it was generated in the first place.

The following functions are provided by this module. Except when explicitly noted
otherwise, all return values are floats.

Number-theoretic functions
Number of ways to choose k items from n items without repetition and
comb(n, k)
without order
factorial(n) n factorial
gcd(*integers) Greatest common divisor of the integer arguments
isqrt(n) Integer square root of a nonnegative integer n
lcm(*integers) Least common multiple of the integer arguments
Number of ways to choose k items from n items without repetition and
perm(n, k)
with order
Floating point arithmetic
ceil(x) Ceiling of x, the smallest integer greater than or equal to x
fabs(x) Absolute value of x
floor(x) Floor of x, the largest integer less than or equal to x
fma(x, y, z) Fused multiply-add operation: (x * y) + z
fmod(x, y) Remainder of division x / y
modf(x) Fractional and integer parts of x
remainder(x, y) Remainder of x with respect to y
trunc(x) Integer part of x

You might also like

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