Operators > % (modulo)

% (modulo)

Syntax

expression1 % expression2

Arguments

expression1, expression2 Numbers, integers, floating-point numbers, or strings that convert to a numeric value.

Description

Operator (arithmetic); calculates the remainder of expression1 divided by expression2. If either of the expression arguments are nonnumeric, the modulo operator attempts to convert them to numbers.

Player

Flash 4 or later. In Flash 4 files, the % operator is expanded in the SWF file as x - int(x/y) * y, and may not be as fast or as accurate as the Flash 5 Player implementation.

Example

The following is a numeric example of using the % operator:

12 % 5 returns 2

4.3 % 2.1 returns 0.1