Mod
The function stands for modulus and returns the remainder after a value is divided by a divisor.
Variants
Mod(Duration dividend, Duration divisor)
Returns the remainder after the dividend is divided by the divisor.
Parameters
- dividend
- The duration for which you want to find the remainder.
- divisor
- The duration by which you want to divide the dividend.
Returns
Duration
Remarks
The function returns the value with the same sign as the divisor.
Examples
Mod(Hours(7), Hours(5))
returns 2 hrs.Mod(Hours(-7), Hours(5))
returns 3 hrs.Mod(Hours(7), Hours(-5))
returns -3 hrs.Mod(Hours(-7), Hours(-5))
returns -2 hrs.
Mod(Numeric dividend, Numeric divisor)
Returns the remainder after the dividend is divided by the divisor.
Parameters
- dividend
- The number for which you want to find the remainder.
- divisor
- The number by which you want to divide the dividend.
Returns
Numeric
Remarks
The function returns the value with the same sign as the divisor.
Examples
Mod(7, 3)
returns 1Mod(7, -3)
returns -2Mod(-7, 3)
returns 2Mod(-7, -3)
returns -1