MOD

Syntax

Description

MOD is the modulus or "remainder" arithmetic operator. The result of MOD is the integer remainder of * argument1* divided by * argument2*.

Both *arguments* should be integers, MOD is not defined for floating
point values.

Example

PRINT 47 MOD 7

PRINT 56 MOD 2

PRINT 5 MOD 3

PRINT 56 MOD 2

PRINT 5 MOD 3

The output would look like:

0

2

Differences from other BASICs

- none from Visual BASIC
- PBASIC uses //

See also