# The math module gives you access to more powerful mathematical tools
# import goes at the top of your file — always

import math

# Constants
print(math.pi)   # 3.141592653589793
print(math.e)    # 2.718281828459045

# Square root — always returns float
print(math.sqrt(16))   # 4.0
print(math.sqrt(2))    # 1.4142135623730951

# Power
print(math.pow(2, 8))  # 256.0 — always returns float
print(2 ** 8)          # 256   — int, using operator

# Floor and ceil
print(math.floor(3.9))  # 3 — rounds down, always
print(math.floor(3.1))  # 3
print(math.ceil(3.1))   # 4 — rounds up, always
print(math.ceil(3.9))   # 4

# Absolute value
print(abs(-5))     # 5 — built-in, no import needed
print(abs(-3.14))  # 3.14

# round() — built-in, no import needed
print(round(3.14159, 2))  # 3.14
print(round(3.14159, 4))  # 3.1416
print(round(3.5))          # 4
print(round(2.5))          # 2 — banker's rounding

# Real examples
# Circle area
radius = 5
area = math.pi * math.pow(radius, 2)
print(f"Circle area: {area:.2f}")   # Circle area: 78.54

# Hypotenuse
a = 3
b = 4
c = math.sqrt(a**2 + b**2)
print(f"Hypotenuse: {c}")           # Hypotenuse: 5.0

# Logarithm
print(math.log(100, 10))  # 2.0 — log base 10 of 100
