Function: mod
mod is a function defined in data.c.
Signature
(mod X Y)
Documentation
Return X modulo Y.
The result falls between zero (inclusive) and Y (exclusive). Both X and Y must be numbers or markers.
Other relevant functions are documented in the number group.
Probably introduced at or before Emacs version 19.19.
Shortdoc
;; number
(mod 10 5)
=> 0
(mod 10 6)
=> 4
(mod 10.5 6)
=> 4.5
Source Code
// Defined in /usr/src/emacs/src/data.c
{
x = check_number_coerce_marker (x);
y = check_number_coerce_marker (y);
if (FLOATP (x) || FLOATP (y))
return fmod_float (x, y);
return integer_remainder (x, y, true);
}