within, go back to Cldr.Math module for more information.
Check if a
number is within a
numberis either an integer or a float.
When an integer, the comparison is made using the standard Elixir
number is a float the comparison is made using the
operators on the range endpoints. Note the comparison for a float is only for
floats that have no fractional part. If a float has a fractional part then
Since this function is only provided to support plural rules, the float comparison is only useful if the float has no fractional part.
iex> Cldr.Math.within(2.0, 1..3) true iex> Cldr.Math.within(2.1, 1..3) false