About
Basic math operations in the Mys programming language.
Example
from math import PI
from math import E
from math import sin
from math import cos
from math import is_nan
from math import sqrt
func main():
print("pi = ", PI)
print("e = ", E)
print("sin(0.0) = ", sin(0.0))
print("cos(0.0) = ", cos(0.0))
print("is_nan(0.0) =", is_nan(0.0))
print("sqrt(4.0) =", sqrt(4.0))
❯ mys run
✔ Reading package configuration (0 seconds)
✔ Building (0.22 seconds)
pi = 3.14159
e = 2.71828
sin(0.0) = 0
cos(0.0) = 1
is_nan(0.0) = False
sqrt(4.0) = 2
API
func sin(angle: f64) -> f64:
Returns the trigonometric sine of given angle in radians.
func cos(angle: f64) -> f64:
Returns the trigonometric cosine of given angle in radians.
func tan(value: f64) -> f64:
func is_nan(value: f64) -> bool:
Returns true if given value is not a number.
func sqrt(value: f64) -> f64:
Returns the square root of given number.
func sqrt(value: f32) -> f32:
Returns the square root of given number.
@generic(T)
func abs(value: T) -> T:
@generic(T)
func div_ceil(numerator: T, denominator: T) -> T:
PI: f64
E: f64