Skip to content

Math

inc

Overload Description
inc(n: @Int) -> () Increment n by one

dec

Overload Description
dec(n: @Int) -> () Decrement n by one

sin

Overload Description
sin(n: Int) -> Float Calculates the sine of n
sin(n: &Int) -> Float
sin(n: @Int) -> Float
sin(n: Float) -> Float
sin(n: &Float) -> Float
sin(n: @Float) -> Float

cos

Overload Description
cos(n: Int) -> Float Calculates the cosine of n
cos(n: &Int) -> Float
cos(n: @Int) -> Float
cos(n: Float) -> Float
cos(n: &Float) -> Float
cos(n: @Float) -> Float

tan

Overload Description
tan(n: Int) -> Float Calculates the tangent of n
tan(n: &Int) -> Float
tan(n: @Int) -> Float
tan(n: Float) -> Float
tan(n: &Float) -> Float
tan(n: @Float) -> Float

sinh

Overload Description
sinh(n: Int) -> Float Calculates the hyperbolic sine of n
sinh(n: &Int) -> Float
sinh(n: @Int) -> Float
sinh(n: Float) -> Float
sinh(n: &Float) -> Float
sinh(n: @Float) -> Float

cosh

Overload Description
cosh(n: Int) -> Float Calculates the hyperbolic cosine of n
cosh(n: &Int) -> Float
cosh(n: @Int) -> Float
cosh(n: Float) -> Float
cosh(n: &Float) -> Float
cosh(n: @Float) -> Float

tanh

Overload Description
tanh(n: Int) -> Float Calculates the hyperbolic tangent of n
tanh(n: &Int) -> Float
tanh(n: @Int) -> Float
tanh(n: Float) -> Float
tanh(n: &Float) -> Float
tanh(n: @Float) -> Float

ln

Overload Description
ln(n: Int) -> Float Calculates the natural logarithm of n
ln(n: &Int) -> Float
ln(n: @Int) -> Float
ln(n: Float) -> Float
ln(n: &Float) -> Float
ln(n: @Float) -> Float

log2

Overload Description
log2(n: Int) -> Float Calculates the base 2 logarithm of n
log2(n: &Int) -> Float
log2(n: @Int) -> Float
log2(n: Float) -> Float
log2(n: &Float) -> Float
log2(n: @Float) -> Float

log10

Overload Description
log10(n: Int) -> Float Calculates the base 10 logarithm of n
log10(n: &Int) -> Float
log10(n: @Int) -> Float
log10(n: Float) -> Float
log10(n: &Float) -> Float
log10(n: @Float) -> Float

exp

Overload Description
exp(n: Int) -> Float Calculates the exponential function of n
exp(n: &Int) -> Float
exp(n: @Int) -> Float
exp(n: Float) -> Float
exp(n: &Float) -> Float
exp(n: @Float) -> Float

sqrt

Overload Description
sqrt(n: Int) -> Float Calculates the square root of n
sqrt(n: &Int) -> Float
sqrt(n: @Int) -> Float
sqrt(n: Float) -> Float
sqrt(n: &Float) -> Float
sqrt(n: @Float) -> Float

floor

Overload Description
floor(n: Float) -> Int Calculates n rounded down to the nearest integer
floor(n: &Float) -> Int
floor(n: @Float) -> Int

ceil

Overload Description
ceil(n: Float) -> Int Calculates n rounded up to the nearest integer
ceil(n: &Float) -> Int
ceil(n: @Float) -> Int

fract

Overload Description
fract(n: Float) -> Float Calculates n rounded up to the nearest integer
fract(n: &Float) -> Float
fract(n: @Float) -> Float

abs

Overload Description
abs(n: Int) -> Float Calculates the absolute value of n
abs(n: &Int) -> Float
abs(n: @Int) -> Float
abs(n: Float) -> Float
abs(n: &Float) -> Float
abs(n: @Float) -> Float

rand

Overload Description
rand() -> Float Generates a random number in the range [0, 1]

rand_int

Overload Description

All reference combinations are defined

rand_int(a: Int, b: Int) -> Float
Generates a random number in the range [a, b]

as_float

Overload Description
as_float(n: Int) -> Float Calculates n as a Float. Note that big numbers might not be represented exactly, since floating point numbers do not have as much precision
as_float(n: &Int) -> Float
as_float(n: @Int) -> Float