Janet 1.27.0-01aab66 Documentation
(Other Versions: 1.26.0 1.25.1 1.24.0 1.23.0 1.22.0 1.21.0 1.20.0 1.19.0 1.18.1 1.17.1 1.16.1 1.15.0 1.13.1 1.12.2 1.11.1 1.10.1 1.9.1 1.8.1 1.7.0 1.6.0 1.5.1 1.5.0 1.4.0 1.3.1 )

Math Module

Index

math/-inf math/abs math/acos math/acosh math/asin math/asinh math/atan math/atan2 math/atanh math/cbrt math/ceil math/cos math/cosh math/e math/erf math/erfc math/exp math/exp2 math/expm1 math/floor math/gamma math/gcd math/hypot math/inf math/int-max math/int-min math/int32-max math/int32-min math/lcm math/log math/log-gamma math/log10 math/log1p math/log2 math/nan math/next math/pi math/pow math/random math/rng math/rng-buffer math/rng-int math/rng-uniform math/round math/seedrandom math/sin math/sinh math/sqrt math/tan math/tanh math/trunc

number math/-inf
The number representing negative infinity
Community Examples / source
cfunction (math/abs x)
Return the absolute value of x.
Community Examples / source
cfunction (math/acos x)
Returns the arccosine of x.
Community Examples / source
cfunction (math/acosh x)
Returns the hyperbolic arccosine of x.
Community Examples / source
cfunction (math/asin x)
Returns the arcsin of x.
Community Examples / source
cfunction (math/asinh x)
Returns the hyperbolic arcsine of x.
Community Examples / source
cfunction (math/atan x)
Returns the arctangent of x.
Community Examples / source
cfunction (math/atan2 y x)
Returns the arctangent of y/x. Works even when x is 0.
Community Examples / source
cfunction (math/atanh x)
Returns the hyperbolic arctangent of x.
Community Examples / source
cfunction (math/cbrt x)
Returns the cube root of x.
Community Examples / source
cfunction (math/ceil x)
Returns the smallest integer value number that is not less than x.
Community Examples / source
cfunction (math/cos x)
Returns the cosine of x.
Community Examples / source
cfunction (math/cosh x)
Returns the hyperbolic cosine of x.
Community Examples / source
number math/e
The base of the natural log.
Community Examples / source
cfunction (math/erf x)
Returns the error function of x.
Community Examples / source
cfunction (math/erfc x)
Returns the complementary error function of x.
Community Examples / source
cfunction (math/exp x)
Returns e to the power of x.
Community Examples / source
cfunction (math/exp2 x)
Returns 2 to the power of x.
Community Examples / source
cfunction (math/expm1 x)
Returns e to the power of x minus 1.
Community Examples / source
cfunction (math/floor x)
Returns the largest integer value number that is not greater than x.
Community Examples / source
cfunction (math/gamma x)
Returns gamma(x).
Community Examples / source
cfunction (math/gcd x y)
Returns the greatest common divisor between x and y.
Community Examples / source
cfunction (math/hypot a b)
Returns c from the equation c^2 = a^2 + b^2.
Community Examples / source
number math/inf
The number representing positive infinity
Community Examples / source
number math/int-max
The maximum contiguous integer represtenable by a double (-(2^53))
Community Examples / source
number math/int-min
The minimum contiguous integer representable by a double (2^53)
Community Examples / source
number math/int32-max
The maximum contiguous integer represtenable by a 32 bit signed integer
Community Examples / source
number math/int32-min
The minimum contiguous integer representable by a 32 bit signed integer
Community Examples / source
cfunction (math/lcm x y)
Returns the least common multiple of x and y.
Community Examples / source
cfunction (math/log x)
Returns the natural logarithm of x.
Community Examples / source
cfunction (math/log-gamma x)
Returns log-gamma(x).
Community Examples / source
cfunction (math/log10 x)
Returns the log base 10 of x.
Community Examples / source
cfunction (math/log1p x)
Returns (log base e of x) + 1 more accurately than (+ (math/log x) 1)
Community Examples / source
cfunction (math/log2 x)
Returns the log base 2 of x.
Community Examples / source
number math/nan
Not a number (IEEE-754 NaN)
Community Examples / source
cfunction (math/next x y)
Returns the next representable floating point value after x in the direction of y.
Community Examples / source
number math/pi
The value pi.
Community Examples / source
cfunction (math/pow a x)
Returns a to the power of x.
Community Examples / source
cfunction (math/random )
Returns a uniformly distributed random number between 0 and 1.
Community Examples / source
cfunction (math/rng &opt seed)
Creates a Psuedo-Random number generator, with an optional seed. The seed should be an unsigned 32 bit integer or a buffer. Do not use this for cryptography. Returns a core/rng abstract type.
Community Examples / source
cfunction (math/rng-buffer rng n &opt buf)
Get n random bytes and put them in a buffer. Creates a new buffer if no buffer is provided, otherwise appends to the given buffer. Returns the buffer.
Community Examples / source
cfunction (math/rng-int rng &opt max)
Extract a random integer in the range [0, max) for max > 0 from the RNG. If max is 0, return 0. If no max is given, the default is 2^31 - 1.
Community Examples / source
cfunction (math/rng-uniform rng)
Extract a random number in the range [0, 1) from the RNG.
Community Examples / source
cfunction (math/round x)
Returns the integer nearest to x.
Community Examples / source
cfunction (math/seedrandom seed)
Set the seed for the random number generator. `seed` should be an integer or a buffer.
Community Examples / source
cfunction (math/sin x)
Returns the sine of x.
Community Examples / source
cfunction (math/sinh x)
Returns the hyperbolic sine of x.
Community Examples / source
cfunction (math/sqrt x)
Returns the square root of x.
Community Examples / source
cfunction (math/tan x)
Returns the tangent of x.
Community Examples / source
cfunction (math/tanh x)
Returns the hyperbolic tangent of x.
Community Examples / source
cfunction (math/trunc x)
Returns the integer between x and 0 nearest to x.
Community Examples / source