πMath
Provides basic constants and mathematical functions.
Methods
math.abs()
math.abs()Returns the absolute, or non-negative value, of a given value.
math.abs(-100)
// expected value: 100math.cos()
math.cos()Returns the cosine of the radian argument.
math.cos(math.pi / 2).round()
// expected value: 0math.isNegative()
math.isNegative()Determines if the specified value is negative.
math.isNegative(-100)
// expected value: truemath.isPositive()
math.isPositive()Determines if the specified value is positive.
math.isPositive(100)
// expected value: truemath.isZero()
math.isZero()Determines if the specified value is zero.
math.isZero(5)
// expected value: falsemath.sin()
math.sin()Returns the sine of the radian argument.
math.sin(math.pi).round()
// expected value: 0math.tan()
math.tan()Returns the tangent of the radian argument.
math.tan(0).round()
// expected value: 0Properties
math.pi
math.piThe mathematical constant Ο = 3.141592β¦, use the round() method to round down to the desired precision.
math.pi.round(2)
// expected value: 3.14math.e
math.eThe mathematical constant e = 2.718281β¦, use the round() method to round down to the desired precision.
math.e.round(2)
// expected value: 2.72math.epsilon
math.epsilonThe mathematical constant π = 2.220446049250e-16, represents the smallest value that a float can have different from zero.
math.epsilon
// expected value: 0.00000000000000022204460492503130808472633361816math.tau
math.tauThe mathematical constant Ο = 6.283185β¦, use the round() method to round down to the desired precision.
math.tau.round(2)
// expected value: 6.28Last updated