RedCrab Calculator

Mod - remainder of a integer division

  • Returns the remainder of the division of two integer numbers

  • If floating point numbers are entered, the Mod operator cuts off all digits after the decimal point before executing the division Mod

  • 11 Mod 3 = 2

  • 11.7 Mod 3.9 = 2

Dividing numbers with different signs also results in different signs for the results. In the following examples the mathematical division and the modulo function as they are integrated in computers are compared.

 7 :  3 =  2 Rest  1

-7 :  3 = -2 Rest -1

 7 : -3 = -2 Rest  1

-7 : -3 =  2 Rest -1

 7 mod  3 =  1

-7 mod  3 = -1

 7 mod -3 =  1

-7 mod -3 = -1


Modulo is the remainder of a Euclidean division. As a standalone feature, modulo is included in most programming languages. It is treated there as a function or operator, usually with the abbreviation mod or %.

In mathematics, it corresponds to the remainder of a division, as described under Euclidean division.
Abs Absolute value of a number
DTime DateTime value
DTimef data field of date and time values
Max Greatest value of two numbers
Min Smallest value of two numbers
Power Returns x to the power y
Rnd Random integer numbers
Rndf Random floating point numbers
Round Rounded to the whole number
Sign Indicating the sign of a number
Sqr Square of the argument
Sqrt Square root of the argument
URnd Different random integer numbers
Div Integer number division
Mod Remainder of an integer division

  Products RedCrab Calculator RedCRab Manual  
      RedCrab Software - Singapore - Sengkang West Way