Home Privacy Policy Feedback Link to us Site Map Forums

Oracle/PLSQL: Remainder Function


In Oracle/PLSQL, the remainder function returns the remainder of m divided by n.

The syntax for the remainder function is:

remainder( m, n )

The remainder is calculated as:

m - (n * X) where X is the integer nearest m / n


Note:

The remainder function uses the round function in its formula, whereas the mod function uses the floor function in its formula.


Applies To:

  • Oracle 10g, Oracle 11g

For example:

remainder(15, 6) would return 3
remainder(15, 5) would return 0
remainder(15, 4) would return -1
remainder(11.6, 2) would return -0.4
remainder(11.6, 2.1) would return -1
remainder(-15, 4) would return 1