math
Mathematical functions for real numbers: sqrt, trig, logs, constants, gcd and more.
Beginner
import math
math.sqrt(2), math.pi, math.e
math.sin(math.radians(30)) # 0.5
math.log10(1000), math.log2(1024)
math.isclose(0.1 + 0.2, 0.3) # True
math.gcd(12, 18), math.comb(5, 2), math.isqrt(99)
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.