The MOD()
function returns the remainder of a dividend divided by a divisor. Figure 1 shows the mathematical representation of the MOD()
function.
MOD(dividend, divisor)
The MOD()
function requires two parameters:
NOTE: A divisor should not be zero.
MOD()
returns the remainder of a dividend divided by a divisor that is sent as a parameter.
NOTE: If a divisor is zero, then
MOD()
returnsNULL
.
/*example showing how to use MOD(X)*/-- positive numberselect MOD(4,3);-- negative numberselect MOD(-6,3);-- fractional numberselect MOD(4.6,2.1);-- zero divisorselect MOD(4,0)