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

Python Math Module Complete

The document provides an overview of the Python math module, detailing its constants such as pi, e, and infinity. It also lists various number-theoretic functions including ceil, floor, factorial, and gcd, among others, which perform mathematical operations and checks. Additionally, it highlights functions for determining properties of numbers like finiteness and closeness.

Uploaded by

yogijetty
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)
6 views1 page

Python Math Module Complete

The document provides an overview of the Python math module, detailing its constants such as pi, e, and infinity. It also lists various number-theoretic functions including ceil, floor, factorial, and gcd, among others, which perform mathematical operations and checks. Additionally, it highlights functions for determining properties of numbers like finiteness and closeness.

Uploaded by

yogijetty
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

Python math Module - All Functions and Constants

1. Constants

math.pi: pi (3.14159...)
math.e: e (2.71828...)
math.tau: tau = 2 * pi (6.28318...)
math.inf: Infinity
math.nan: Not a Number (NaN)

2. Number-theoretic and Representation Functions

math.ceil(x): Smallest integer >= x


math.floor(x): Largest integer <= x
math.trunc(x): Truncates decimal part
math.fabs(x): Absolute value (float)
math.factorial(x): x! (x factorial)
math.fmod(x, y): Remainder of x / y (float result)
math.remainder(x, y): IEEE 754-style remainder
math.modf(x): (fractional_part, integer_part) of x
math.isfinite(x): True if x is not inf or NaN
math.isinf(x): True if x is infinity
math.isnan(x): True if x is NaN
math.gcd(x, y): Greatest Common Divisor
math.lcm(x, y): Least Common Multiple (Python 3.9+)
math.copysign(x, y): Returns x with the sign of y
math.isclose(a, b): True if a is close to b (within a tolerance)

You might also like