Math: Arithmetic

Nodes in this category perform common arithmetic operations on numerical values (and where applicable, vec2 values).

Nodes

NodeDetailsPossible Types
Add

The addition operation (+) calculates the sum of two scalar numbers or vectors.

f64 → f64
f32 → f32
u32 → u32
Vec2 → Vec2
f64 → Vec2
Divide

The division operation (÷) calculates the quotient of two scalar numbers or vectors.

Produces 0 if the denominator is 0.

f64 → f64
f32 → f32
u32 → u32
Vec2 → Vec2
f64 → Vec2
Exponent

The exponent operation (^) calculates the result of raising a number to a power.

f64 → f64
f32 → f32
u32 → u32
Logarithm

The logarithmic function (log) calculates the logarithm of a number with a specified base. If the natural logarithm function (ln) is desired, set the base to "e".

f64 → f64
f32 → f32
Math

Calculates a mathematical expression with input values "A" and "B".

f64 → f64
f32 → f32
Modulo

The modulo operation (%) calculates the remainder from the division of two scalar numbers or vectors.

The sign of the result shares the sign of the numerator unless Always Positive is enabled.

f64 → f64
f32 → f32
u32 → u32
Vec2 → Vec2
f64 → Vec2
Multiply

The multiplication operation (×) calculates the product of two scalar numbers, vectors, or transforms.

f64 → f64
f32 → f32
u32 → u32
Vec2 → Vec2
f64 → Vec2
Transform → Transform
Reciprocal

The reciprocal operation (1/x) calculates the multiplicative inverse of a number.

Produces 0 if the input is 0.

f64 → f64
f32 → f32
Root

The nth root operation (√) calculates the inverse of exponentiation. Square root inverts squaring, cube root inverts cubing, and so on.

This is equivalent to raising the number to the power of 1/n.

f64 → f64
f32 → f32
Subtract

The subtraction operation (-) calculates the difference between two scalar numbers or vectors.

f64 → f64
f32 → f32
u32 → u32
Vec2 → Vec2
f64 → Vec2