Skip to content

math

Mathematical constants and functions.

Constants

E

math::E

Euler's number (2.71828...)

INF

math::INF

Positive infinity

NAN

math::NAN

Not-a-number

PI

math::PI

Pi constant (3.14159...)

TAU

math::TAU

Tau (2π)

Functions

abs

math::abs(x)

Absolute value

atan2

math::atan2(y, x)

Two-argument arctangent

ceil

math::ceil(x)

Ceiling (round up)

clamp

math::clamp(x, lo, hi)

Clamp value to range

cos

math::cos(x)

Cosine

floor

math::floor(x)

Floor (round down)

is_inf

math::is_inf(x)

Check if infinite

is_nan

math::is_nan(x)

Check if NaN

log

math::log(x)

Natural logarithm

log10

math::log10(x)

Base-10 logarithm

log2

math::log2(x)

Base-2 logarithm

max

math::max(a, b)

Maximum of arguments

min

math::min(a, b)

Minimum of arguments

pow

math::pow(base, exp)

Exponentiation

round

math::round(x)

Round to nearest

sin

math::sin(x)

Sine

sqrt

math::sqrt(x)

Square root

tan

math::tan(x)

Tangent

Documentation reflects Ion v0.2.0-66-g3faa376.