Name

mod — returns the modulus of its arguments

Synopsis

mod ( dividend integer ,
divisor integer );

Description

mod returns the modulus (i.e. remainder) of the division dividend/divisor. If the divisor is zero the SQL error 22012 "Division by zero" is generated.

mod(35,3)                       -> 2
mod(35,-3)                      -> 2
mod(-35,3)                      -> -2
mod(-35,-3)                     -> -2
mod(3,35)                       -> 3
mod(0,7)                        -> 0
mod(60,3)                       -> 0