You're seeing just the function mod, go back to Cldr.Math module for more information.


Calculates the modulo of a number (integer, float or Decimal).

Note that this function uses floored division whereas the builtin rem function uses truncated division. See Decimal.rem/2 if you want a truncated division function for Decimals that will return the same value as the BIF rem/2 but in Decimal form.

See Wikipedia for an explanation of the difference.


iex> Cldr.Math.mod(1234.0, 5)

iex> Cldr.Math.mod("1234.456"), 5)

iex> Cldr.Math.mod("123.456"),"3.4"))

iex> Cldr.Math.mod"123.456"), 3.4