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,atanh
These functions take and return float.
The module defines a RealFuns protocol and implements it
for float. The exported module functions delegate through
that protocol.