613-518-1166 info@zimdatabases.com

ZIM Language Reference

$modulus

< All Topics

$modulus

Calculates one number modulo another.

Syntax

$modulus(expr1,expr2)

Parameters

expr1

a number, or an expression that evaluates to a number

expr2

a number, or an expression that evaluates to a number

Return Value

Number, with no decimal places.

Comments

Expr1 modulo expr2 is the remainder of the division of expr1 by expr2.

Before the operation is carried out, expr1 and expr2 are rounded, if necessary, to yield integer values.

Example

$modulus(5,2)

Evaluates to 1.

$modulus(5.2,2.43)

Evaluates to 1.

$modulus(Age,10)

Evaluates to 4 if Age is 54.

 

See Also

About Functional Expressions

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Table of Contents