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
f64[] → f64[]
f32 → f32
f32[] → f32[]
i32 → i32
i32[] → i32[]
i64 → i64
i64[] → i64[]
Vec2 → Vec2
Vec2[] → Vec2[]
Average

Averages all the numbers in the input list. An empty list gives 0.

f64[] → f64
Ceiling

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

f64 → f64
f64[] → f64[]
f32 → f32
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
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
String → String
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
f64[] → f64[]
f32 → f32
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
u32[] → u32[]
u64 → u64
u64[] → u64[]
i32 → i32
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
u32[] → u32[]
u64 → u64
u64[] → u64[]
i32 → i32
i32[] → i32[]
Max

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

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
String → String
String[] → String[]
Maximum

Gives the largest number in the input list. An empty list gives 0.

f64[] → f64
Min

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

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
String → String
String[] → String[]
Minimum

Gives the smallest number in the input list. An empty list gives 0.

f64[] → f64
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
→ 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
f64[] → f64[]
f32 → f32
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
f64[] → f64[]
f32 → f32
f32[] → f32[]
Sum

Adds together all the numbers in the input list, producing their total.

f64[] → f64