Skip to main content
Module

x/ramda/mod.ts>mathMod

:ram: Practical functional Javascript
Latest
variable mathMod
import { mathMod } from "https://deno.land/x/ramda@v0.27.2/mod.ts";

mathMod behaves like the modulo operator should mathematically, unlike the % operator (and by extension, R.modulo). So while -17 % 5 is -2, mathMod(-17, 5) is 3. mathMod requires Integer arguments, and returns NaN when the modulus is zero or negative.