Math Codeblocks Reference

What's New: 2027

The Math category offers basic arithmetic, trigonometric, and list-based functions, plus iLogic blocks. Use these blocks to perform calculations and evaluate numeric data within your visual program.

Inputs include

Number

The Number codeblock provides an input which holds a decimal value.

The default value is 0. Number is unitless, so you need to include units when they are needed for the output.

Math

The Math codeblock performs a mathematical operation on two numbers.

Operators include:

Function

The Function codeblock performs a mathematical function on an input.

Functions include:

Trigonometry

The Trigonometry codeblock performs trigonometric functions on an input.

Functions include:

Numeric Constant

The Numeric Constant codeblock returns a common math constant value.

Number Property

The Number Property codeblock returns a number constant value.

Aggregate

The Aggregate codeblock returns a specified value from a list input.

Round

The Round codeblock rounds an input.

Options include:

Remainder

The Remainder codeblock returns the the amount left over when one input is divided by the other. The Remainder codeblock requires two inputs, a divisor and a dividend.

Constrain

The Constrain codeblock tests an input against two numbers. The numbers represent the lower and upper limit of the acceptable range.

If the input value tested is within the two limit numbers, the value itself is returned.

If the input value is outside of the acceptable range, the value returned is the limit number closest to the input value.

Examples:

Random Integer

The Random Number codeblock generates random numbers between two specified numbers.

Random Fraction

The Random Fraction codeblock generates random fractions between 0 and 1.

Arctangent

The Arctangent codeblock returns the arctangent of an X,Y point in degrees from -180 to 180.

Test Number

The Test Number codeblock checks to make sure a variable value is a valid number.

MinMax

The MinMax codeblock returns the minimum or maximum number from a list of values.

RoundPlaces

The RoundPlaces codeblock rounds a value to a specified number of decimal places.

Sign of

The Sign of codeblock returns -1 for values below zero, 0 for the value of zero, and 1 for values above zero.

Integer of

The Integer of codeblock removes the fractional part of a number.

Convert

The Convert codeblock converts text (string) into a number.

IsEqual

The IsEqual codeblock returns True if two numbers are equal within the specified tolerance.