KitchenSink v1.1.0 KitchenSink.Math View Source

Math functions!

Link to this section Summary

Link to this section Functions

Link to this function div(numerator, denominator, div_by_zero) View Source

handles divide by zero gracefully.

third argument is what to return when you divide by zero.

Link to this function round_up_to_multiple(number, significance) View Source

Always round up to the nearest multiple of significance.

Parameters

  • number: The number you wish to have rounded.
  • significance: The multiple to which you would like to round. Must not be 0.

Example:

iex> round_up_to_multiple(31, 5) 35

iex> round_up_to_multiple(29.49, 10) 30