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.

With a vec2 input, this applies separately to the X and Y components. For the overall length of a vec2, see the "Magnitude" node instead.

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.

With a vec2 input, this applies separately to the X and Y components.

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

With vec2 inputs, this applies separately to the X and Y components.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
String → String
String[] → String[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]
Floor

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

With a vec2 input, this applies separately to the X and Y components.

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

Linearly interpolates between the start and end values, where a factor of 0 gives the start value, 1 gives the end value, and 0.5 gives their midpoint.

With vec2 inputs, this traces the straight line path between the two points.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
Vec2 → Vec2
Vec2[] → Vec2[]
Max

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

With vec2 inputs, this applies separately to the X and Y components.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
String → String
String[] → String[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]
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.

With vec2 inputs, this applies separately to the X and Y components.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
u32 → u32
u32[] → u32[]
String → String
String[] → String[]
Vec2 → Vec2
Vec2[] → Vec2[]
f64 → Vec2
f64[] → Vec2[]
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.

With a vec2 input, this applies separately to the X and Y components.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
Vec2 → Vec2
Vec2[] → Vec2[]
Sign

The sign function (sign) reports whether an input value is positive (1), negative (-1), or zero (0).

With a vec2 input, this applies separately to the X and Y components.

f64 → f64
f64[] → f64[]
f32 → f32
f32[] → f32[]
Vec2 → Vec2
Vec2[] → Vec2[]
Sum

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

f64[] → f64