Factry Historian
...
Standard Library
math
module "math" tengo math = import("math") constants e pi phi sqrt2 sqrte sprtpi sqrtphi ln2 log2e ln10 ln10e mathematical constants maxfloat32 smallestnonzerofloat32 maxfloat64 smallestnonzerofloat64 floating point limit values max is the largest finite value representable by the type smallestnonzero is the smallest positive, non zero value representable by the type maxint minint maxint8 minint8 maxint16 minint16 maxint32 minint32 maxint64 minint64 integer limit values functions abs(x float) => float returns the absolute value of x acos(x float) => float returns the arccosine, in radians, of x acosh(x float) => float returns the inverse hyperbolic cosine of x asin(x float) => float returns the arcsine, in radians, of x asinh(x float) => float returns the inverse hyperbolic sine of x atan(x float) => float returns the arctangent, in radians, of x atan2(y float, xfloat) => float returns the arc tangent of y/x, using the signs of the two to determine the quadrant of the return value atanh(x float) => float returns the inverse hyperbolic tangent of x cbrt(x float) => float returns the cube root of x ceil(x float) => float returns the least integer value greater than or equal to x copysign(x float, y float) => float returns a value with the magnitude of x and the sign of y cos(x float) => float returns the cosine of the radian argument x cosh(x float) => float returns the hyperbolic cosine of x dim(x float, y float) => float returns the maximum of x y or 0 erf(x float) => float returns the error function of x erfc(x float) => float returns the complementary error function of x exp(x float) => float returns e x, the base e exponential of x exp2(x float) => float returns 2 x, the base 2 exponential of x expm1(x float) => float returns e x 1, the base e exponential of x minus 1 it is more accurate than exp(x) 1 when x is near zero floor(x float) => float returns the greatest integer value less than or equal to x gamma(x float) => float returns the gamma function of x hypot(p float, q float) => float returns sqrt(p p + q q) , taking care to avoid unnecessary overflow and underflow ilogb(x float) => float returns the binary exponent of x as an integer inf(sign int) => float returns positive infinity if sign >= 0, negative infinity if sign < 0 is inf(f float, sign int) => float reports whether f is an infinity, according to sign if sign > 0, isinf reports whether f is positive infinity if sign < 0, isinf reports whether f is negative infinity if sign == 0, isinf reports whether f is either infinity is nan(f float) => float reports whether f is an ieee 754 ``not a number'' value j0(x float) => float returns the order zero bessel function of the first kind j1(x float) => float returns the order one bessel function of the first kind jn(n int, x float) => float returns the order n bessel function of the first kind ldexp(frac float, exp int) => float is the inverse of frexp it returns frac × 2 exp log(x float) => float returns the natural logarithm of x log10(x float) => float returns the decimal logarithm of x log1p(x float) => float returns the natural logarithm of 1 plus its argument x it is more accurate than log(1 + x) when x is near zero log2(x float) => float returns the binary logarithm of x logb(x float) => float returns the binary exponent of x max(x float, y float) => float returns the larger of x or y min(x float, y float) => float returns the smaller of x or y mod(x float, y float) => float returns the floating point remainder of x/y nan() => float returns an ieee 754 ``not a number'' value nextafter(x float, y float) => float returns the next representable float64 value after x towards y pow(x float, y float) => float returns x y, the base x exponential of y pow10(n int) => float returns 10 n, the base 10 exponential of n remainder(x float, y float) => float returns the ieee 754 floating point remainder of x/y signbit(x float) => float returns true if x is negative or negative zero sin(x float) => float returns the sine of the radian argument x sinh(x float) => float returns the hyperbolic sine of x sqrt(x float) => float returns the square root of x tan(x float) => float returns the tangent of the radian argument x tanh(x float) => float returns the hyperbolic tangent of x trunc(x float) => float returns the integer value of x y0(x float) => float returns the order zero bessel function of the second kind y1(x float) => float returns the order one bessel function of the second kind yn(n int, x float) => float returns the order n bessel function of the second kind