Binary Operator "%"

QuantScript's binary mod

%
operator implements arithmetic modulo.

Examples:

1 29 % 5 # -> 4
2 29 % 4 # -> 1
3 29 % 3 # -> 2
4 29 % 2 # -> 1
5 29 % 1 # -> 0
6 29 % 0 # -> unknown

Table of Operands

Anything not listed here results in an Unknown.
This operator is not commutative -

x % y
is not always the same as
y % x
.
This operator is not type-commutative - the type of
x % y
is not always the same as the type of
y % x
.
This operator is left associative -
x % y % z
is the same as
(x % y) % z
.

Left OperandOperatorRight OperandResult
Number%Number == 0Unknown
Number%NumberNumber
Number%Series<Number>Series<Number|Unknown>
Number%MultiDataset<Number> == 0MultiDataset<Unknown>
Number%MultiDataset<Number>MultiDataset<Number>
Series<Number>%MultiDataset<Number> == 0MultiDataset<Unknown>
Series<Number>%MultiDataset<Number>MultiDataset<Number>