Range.new
You're seeing just the function
new
, go back to Range module for more information.
Specs
Creates a new range.
If first
is less than last
, the range will be increasing from
first
to last
. If first
is equal to last
, the range will contain
one element, which is the number itself.
If first
is greater than last
, the range will be decreasing from first
to last
, albeit this behaviour is deprecated. Therefore, it is advised to
explicitly list the step with new/3
.
Examples
iex> Range.new(-100, 100)
-100..100
Specs
Creates a new range with step
.
Examples
iex> Range.new(-100, 100, 2)
-100..100//2