mod

functionsince v0.0-927 clojure.core/modEdit
(mod n d)

Details:

Returns the modulus of dividing numerator n by denominator d.

Returns NaN when d is 0 (divide by 0 error).

Truncates toward negative infinity.


Examples:

(mod -5 3)
;;=> 1

(mod 5 3)
;;=> 2

(mod 5 0)
;;=> NaN

See Also:


Source docstring:
Modulus of num and div. Truncates toward negative infinity.
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn mod
  [n d]
  (js-mod (+ (js-mod n d) d) d))