Calendrical v0.1.0 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 floats

Recentre an angle into the range [-180, 180) degrees

Subtract y from x

Link to this section Functions

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 floats.

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