Math: Numeric

Nodes in this category perform discontinuous numeric operations such as rounding, clamping, mapping, and randomization.

Nodes

NodeDetailsPossible Types
Absolute Value

The absolute value function (abs) removes the negative sign from an input value, if present.

f64 → f64
f32 → f32
i32 → i32
i64 → i64
vec2 → vec2
Ceiling

The ceiling function (ceil) rounds up an input value to the nearest whole number, unless the input number is already whole.

f64 → f64
f32 → f32
Clamp

The clamp function (clamp) restricts a number to a specified range between a minimum and maximum value. The minimum and maximum values are automatically swapped if they are reversed.

f64 → f64
f32 → f32
u32 → u32
string → string
Floor

The floor function (floor) rounds down an input value to the nearest whole number, unless the input number is already whole.

f64 → f64
f32 → f32
Greatest Common Divisor

The greatest common divisor (GCD) calculates the largest positive integer that divides both of the two input numbers without leaving a remainder.

u32 → u32
u64 → u64
i32 → i32
Least Common Multiple

The least common multiple (LCM) calculates the smallest positive integer that is a multiple of both of the two input numbers.

u32 → u32
u64 → u64
i32 → i32
Max

The maximum function (max) picks the larger of two numbers.

f64 → f64
f32 → f32
u32 → u32
string → string
Min

The minimum function (min) picks the smaller of two numbers.

f64 → f64
f32 → f32
u32 → u32
string → string
Random

The random function (rand) converts a seed into a random number within the specified range, inclusive of the minimum and exclusive of the maximum. The minimum and maximum values are automatically swapped if they are reversed.

→ f64
Remap

Linearly maps an input value from one range to another. The ranges may be reversed.

For example, 0.5 in the input range [0, 1] would map to 0 in the output range [-180, 180].

f64 → f64
f32 → f32
Round

The rounding function (round) maps an input value to its nearest whole number. Halfway values are rounded away from zero.

f64 → f64
f32 → f32