Team LiB   Previous Section   Next Section
m od

Syntax

set theMod to 63 mod 20 -- returns 3

Return value

integer or real

Description

The mod operator divides its left operand by the right operand and returns any remainder (otherwise zero), rather than returning the division result. See the section on the div operator, which does the opposite; it returns the division result and throws out the remainder.

Examples

set theMod to 63 mod 20.0 -- result is an integer 3



set theMod to 63.0 mod 20 -- result is a real  3.0



set theMod to 63 mod 20.1 -- result is a real 2.7



set theMod to 63.0 mod 20.0 -- result is an real 3.0
    Team LiB   Previous Section   Next Section