Modulus

Description:

Perform Mod operation or integer division on two integers.

Syntax:

x%y

Get remainder

x\y

Get the integer part

Note:

The operation gets the integer part or the remainder part after division of one integer/decimal without the fractional part/long integer by another.

Parameters:

x

An integer, a decimal without the fractional part, or a long integer

y

An integer, a decimal without the fractional part, or a long integer

Return value:

An integer

Example:

 

A

 

1

=7%2

1

2

=7\2

3

Related functions:

cmp()