math
The math module provides the constant pi and common floating-point
functions.
Source:
import math
actor main(env):
angle = math.pi / 4.0
print(math.sin(angle))
print(math.sqrt(9.0))
env.exit(0)
Import the module first with import math, then call its
functions as math.sqrt(...), math.sin(...),
and so on.
The module currently exposes:
pisqrt,exp,logsin,cos,tanasin,acos,atansinh,cosh,tanhasinh,acosh,atanhldexp(x, exp), which returnsx * 2**exp
All functions return float. ldexp also takes an int exponent.