Calendrical v0.1.2 Calendrical.Math View Source
Link to this section Summary
Functions
Add y
to x
Returns the adjusted modulus of x
and y
Returns the quotient and modulo of x over y using a mod
function
that works with integer
and floats
Returns the greatest common divisor of x
and y
Returns the least common multiple of x
and y
Returns x
modulus y
but unlike the builtin rem
, also works for float
s
Recentre an angle into the range [-180, 180) degrees
Subtract y
from x
Link to this section Functions
Add y
to x
Returns the adjusted modulus of x
and y
Returns the quotient and modulo of x over y using a mod
function
that works with integer
and floats
.
Returns the greatest common divisor of x
and y
Returns the least common multiple of x
and y
Returns x
modulus y
but unlike the builtin rem
, also works for float
s.
Examples
iex> Calendrical.Math.mod(9, -5) -1
iex> Calendrical.Math.mod(-9, 5) 1
iex> Calendrical.Math.mod(9, 5) 4
iex> Calendrical.Math.mod(-9,-5) -4
iex> Calendrical.Math.mod(5/3, 3/4) |> Float.round(5) 0.16667
Recentre an angle into the range [-180, 180) degrees
Subtract y
from x