[erlang-questions] Which EEP would you pick as the most important one to implement next?
Ivan Uemlianin
ivan@REDACTED
Fri Aug 31 11:59:18 CEST 2012
On 31/08/2012 10:56, Jesper Louis Andersen wrote:
> clamp(X, Lo, Hi) ->
> min(max(X, Lo), Hi).
>
> (Brace for mistakes - I might have gotten it wrong). The idea is to provide a limit on X. X will never go below Lo and will never go beyond Hi. It turns out that my code is using this quite a lot, and often in inner loops, so getting a fast variant could be useful.
Looks interesting. Are the values integers or floats? What about a NIF?
Ivan
--
============================================================
Ivan A. Uemlianin PhD
Llaisdy
Speech Technology Research and Development
ivan@REDACTED
www.llaisdy.com
llaisdy.wordpress.com
github.com/llaisdy
www.linkedin.com/in/ivanuemlianin
"hilaritas excessum habere nequit"
(Spinoza, Ethica, IV, XLII)
============================================================
More information about the erlang-questions
mailing list