PL/SQL Mod

The Mod function returns the remainder of n2 divided by n1.

Mod syntax

MOD ( n2, n1 )

Mod example

select mod(19,8) from dual;	

Result: 3


select mod(-19,8) from dual;	

Result: -3

select mod(19,0) from dual;	

Result: 19


select mod(19.7,2) from dual;	

Result: 1.7


select mod(19.7,2.1) from dual;

Result: 0.8