View Source Flamel.Number (flamel v1.10.0)

Documentation for Flamel.Number.

Summary

Functions

Returns value clamped to the inclusive range of min and max.

Functions

Link to this function

clamp(value, min, max \\ :infinity)

View Source
@spec clamp(integer(), integer(), integer() | :infinity) :: integer()

Returns value clamped to the inclusive range of min and max.

iex> Flamel.Number.clamp(-10, 0)
0

iex> Flamel.Number.clamp(20, 0, 10)
10

iex> Flamel.Number.clamp(20, 0)
20