The remainder() function
karambosMay 20 2013 — edited May 20 2013AFAIK, REMAINDER() works like this:
m - (n * X) where X is the integer nearest m / n
so if we're dealing with REMAINDER(13,5), the result of 13/5 = 2.6 and the nearest integer to 2.6 is 3. I'm assuming you find the nearest integer by using ROUND(). So the result is calculated as 13-(5*3) = 13-15 = -2
So my question is: why is REMAINDER(15,6) = 3?
My thinking is this: 15/6 = 2.5 and the nearest integer to 2.5 is 3. So 15-(6*3) = 15-18 = -3.
so why does sqlplus return +3?
Sorry for such a simple question but I'm a noob studying for the OCA. Any advice appreciated