Operators

mod

Supported By

Syntax

expression mod expression

Each expression yields an integer, a number, or a complex.

Description

The mod operator evaluates to the modulus of the given values. (In HyperTalk, the mod operator evaluates to the remainder after division instead.)

Notes

If either given value is a complex, the evaluated value will be a complex. Otherwise, the evaluated value will be a number.

In XION, the expression x mod y is equivalent to x-y*floor(x/y).

Compatibility

In HyperTalk, the expression x mod y is equivalent to x-y*trunc(x/y). What HyperTalk calls the mod operator is implemented in XION as the rem operator instead. This does not change the value of the operator for positive values, but does change the value of the operator for negative values.

See Also

rem, /, quot, div