math

Stdlib — MathPython 2.0+Beginner

Mathematical functions: sqrt, sin, cos, log, factorial, pi, e, inf, nan

Quick Info

Documentation
Official Docs
Python Version
2.0+
Dependencies
None — Python Standard Library
Install
Included with Python

Learn by Difficulty

Quick Example

python
import math

print(f"Pi: {math.pi}")
print(f"E: {math.e}")
print(f"sqrt(16): {math.sqrt(16)}")
print(f"ceil(3.2): {math.ceil(3.2)}")
print(f"floor(3.8): {math.floor(3.8)}")

The math module is part of Python's standard library. Mathematical functions: sqrt, sin, cos, log, factorial, pi, e, inf, nan.

Try in Playground

Tags

stdlibmathnumerictrigonometry

Related Items