Pages

OracleEBSpro is purely for knowledge sharing and learning purpose, with the main focus on Oracle E-Business Suite Product and other related Oracle Technologies.

I'm NOT responsible for any damages in whatever form caused by the usage of the content of this blog.

I share my Oracle knowledge through this blog. All my posts in this blog are based on my experience, reading oracle websites, books, forums and other blogs. I invite people to read and suggest ways to improve this blog.


Wednesday, February 27, 2013

Oracle PLSQL: Remainder Function


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

Syntax

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 11g, Oracle 10g

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

No comments:

Post a Comment