A newer version of Max is available. Click here to access the latest version of the Max documentation

mod Reference

Divide two values, output the remainder

mod

Examples

Inlets

Left Operand [number]

The value is divided by the value in the right inlet and the remainder is sent out the outlet.

Right Operand [number]

The value is stored as the divisor (the value to be divided into the value in the left inlet) for calculating the remainder.

Outlets

Left % Right [number]

The modulo output

Fixed Attributes

These attributes must be set in the object box and determine the behavior of the object at runtime.

hot [bool] (default: 0)

All inlets trigger calculation.

Dynamic Attributes

These attributes can be modified in the code during execution using the set object

in1 [number]

The value is divided by the value in the right inlet and the remainder is sent out the outlet.

in2 [number]

The value is stored as the divisor (the value to be divided into the value in the left inlet) for calculating the remainder.

reset [bang] (default: 0)

Reset inlets to default values.

See Also

Name Description
rmod Reverse modulo (divide two values, output the remainder)
rmod~ Reverse modulo (divide two values, output the remainder)
mod~ Divide two values, output the remainder