Modulo

library operator
ID: 38ee1ac9-4dac-4e8d-b983-c90707a04364
Emits the modulo, the remainer of a division of two numbers A and B.

Behavior

Test data showing the behavior of Modulo

Positive integers

It returns the remainder of an integer division.

Input Output
{"a":1,"b":1} 0
{"a":2,"b":5} 2
{"a":8,"b":3} 2
Floats

It can even cope with floats.

Input Output
{"a":3.5,"b":2.1} 1.4
{"a":-18.25,"b":9} -0.25
{"a":-182.7,"b":-39.3} -25.5
Negative integers

It can also process negative integers.

Input Output
{"a":-2,"b":5} -2
{"a":2,"b":-5} 2
{"a":-2,"b":-5} -2

Implementation

The implementation of Modulo makes use of the following 1 operators.

1
Evaluates an expression.