A great example of an idempotent function is the absolute value function. abs(-4) = 4abs(4) = 4. Continuing to apply abs() onto itself will always yield the same result.
For those that have done some Elixir before: -4 |> abs |> abs |> ... will always yield 4
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
A great example of an idempotent function is the absolute value function.
abs(-4) = 4
abs(4) = 4
. Continuing to applyabs()
onto itself will always yield the same result.For those that have done some Elixir before:
-4 |> abs |> abs |> ...
will always yield4