This Oracle tutorial explains how to use the Oracle/PLSQL REMAINDER function with syntax and examples.
The Oracle/PLSQL REMAINDER function returns the remainder of m divided by n.
The syntax for the REMAINDER function in Oracle/PLSQL is:
REMAINDER( m, n )
A numeric value used in the calculation.
A numeric value used in the calculation.
The REMAINDER is calculated as follows:
m - (n * X)
where X is the integer nearest m / n
The REMAINDER function returns a numeric value.
The REMAINDER function can be used in the following versions of Oracle/PLSQL:
Let's look at some Oracle REMAINDER function examples and explore how to use the REMAINDER function in Oracle/PLSQL.
For example:
REMAINDER(15, 6)
Output: 3
REMAINDER(15, 5)
Output: 0
REMAINDER(15, 4)
Output: -1
REMAINDER(11.6, 2)
Output: -0.4
REMAINDER(11.6, 2.1)
Output: -1
REMAINDER(-15, 4)
Output: 1