Fmath API
Functions
Section titled “Functions”MaxFixed
Section titled “MaxFixed”MaxFixed() -> fixedReturns the maximum value a fixedpoint integer can take.
RandomFixed
Section titled “RandomFixed”RandomFixed(fixed min, fixed max) -> fixedReturns a random fixedpoint value in the range [min, max]. max must be greater or equal to min.
RandomNumber
Section titled “RandomNumber”RandomNumber(number min, number max) -> numberReturns an integer in the range [min, max]. max must be greater or equal to min.
Sqrt(fixed x) -> fixedReturns the square root of x. x must be greater or equal to 0.
FromFraction
Section titled “FromFraction”FromFraction(number numerator, number denominator) -> fixedReturns the fixedpoint value representing the fraction numerator/denominator. denominator must not be equal to zero.
ToNumber
Section titled “ToNumber”ToNumber(fixed value) -> numberReturns the integral part of the value.
AbsFixed
Section titled “AbsFixed”AbsFixed(fixed value) -> fixedReturns the absolute value.
ToFixed
Section titled “ToFixed”ToFixed(number value) -> fixedReturns a fixedpoint value with the integral part of value, and no fractional part.
Sincos
Section titled “Sincos”Sincos(fixed angle) -> (fixed, fixed)Returns the sinus and cosinus of angle. angle is in radian.
Atan2(fixed y, fixed x) -> fixedReturns the principal value of the arc tangent of y/x. Returns a value in the range [0, 2π[.
Tau() -> fixedReturns τ (aka 2π).