Remainder Building Block

The Remainder building block divides one Number value, or an optional predetermined constant value, into another Number value and uses the remainder of the result as the block's output value. The sign of the output value can be taken from either the dividend or divisor value.

A Remainder building block has a "#" input value and an optional "÷" input value. When either input value changes, the building block will divide the "#" input value by the "÷" input value and use the remainder of the result as the block's output value. If the block is configured with a constant value, it will divide the "#" input value by the constant value and use the remainder of the result as the block's output value.

If the Remainder block has both a "÷" and a constant value, it will first divide the "#" input value by the "÷" input value and round the result to the nearest whole number. The block will then divide that result by the constant value and use the remainder of the result as the block's output value.

To configure a Remainder building block, enable the "÷" input to divide one input value by another. To divide by a constant value from the input values, enable the Divide by button and enter the desired value.

In the example to the right, the building block will not have a "÷" input, will divide its "#" input value by "8", and will use the remainder of the result as its output value. The output will always be a positive number since the building block is configured to use the sign of the divisor for the output and the divisor will always be "8".