- ✕This summary was generated using AI based on multiple online sources. To view the original source information, use the "Learn more" links.
Python provides a built-in module called math that offers a wide range of mathematical functions and constants. This module is essential for performing various mathematical operations, from basic arithmetic to complex trigonometric calculations.
Basic Usage
To use the math module, you need to import it first:
import mathCopied!✕CopyCommon Functions
Here are some commonly used functions in the math module:
math.ceil(x): Returns the smallest integer greater than or equal to x.
math.floor(x): Returns the largest integer less than or equal to x.
math.fabs(x): Returns the absolute value of x.
math.factorial(x): Returns the factorial of x.
math.gcd(x, y): Returns the greatest common divisor of x and y.
math.sqrt(x): Returns the square root of x.
math.pow(x, y): Returns x raised to the power of y.
math.log(x, base): Returns the logarithm of x to the specified base.
Example:
Python math Module - W3Schools
50 rows · Learn how to use the built-in math module in Python for various mathematical tasks. The …
See all 50 rows on www.w3schools.comMETHOD DESCRIPTION math.acos () Returns the arc cosine of a number math.acosh () Returns the inverse hyperbolic cosine of ... math.asin () Returns the arc sine of a number math.asinh () Returns the inverse hyperbolic sine of a ...
Python Math Module - GeeksforGeeks
Jul 26, 2025 · The math module in Python is a built-in library that contains a collection of mathematical functions and constants. It is commonly used to perform standard math operations such as rounding, …
The Python math Module: Everything You Need to Know
Learn how to use the math module in Python for higher-level mathematical operations, such as exponential, logarithmic, trigonometric, and power functions. …
All Mathematical Functions Defined under Math Module in Python 3
45 rows · Learn how to use the math module in Python to access various mathematical functions and constants. See the list of functions, their descriptions, and examples of how to apply them in your code.
Python - math Module - Online Tutorials Library
Learn how to use the math module in Python for performing mathematical operations. The module provides various methods for trigonometric, power, …
- People also ask
Master Python's Math Module for Math Functions
May 10, 2025 · Learn how to use Python's math module for basic and advanced math operations. It provides functions for square roots, powers, trigonometry, …
Python Math Tutorial
Explore Python’s math module with tutorials covering number-theoretic, power, logarithmic, trigonometric, and angular conversion functions. Learn syntax, examples, and applications of …
2.6 The math module - Introduction to Python …
The complete list of built-in functions is available in Python's official documentation. A commonly used module in the standard library is the math …
Python math Module - TutorialsTeacher.com
Learn how to use the math module in Python to perform various mathematical operations and calculations. The module provides functions for trigonometry, logarithms, exponents, powers, roots, …