[eeps] Multi-Parameter Typechecking BIFs

Bjorn Gustavsson bgustavsson@REDACTED
Fri Mar 6 12:32:48 CET 2009


[I am going trough my star-marked emails...]

On Thu, Feb 26, 2009 at 12:52 AM, Richard O'Keefe <ok@REDACTED> wrote:
>
> In average/1, what is the reason for
>     V0 = if
>              V10 =:= V20 -> V10;
>              is_float(V10) -> 0.5*(V10+V20)
>          end,
> rather than
>     V0 = (V10+V20)*0.5

To save heap space. Instead of allocating another three words on the heap,
we'll just return an already existing float.

/Bjorn
-- 
Björn Gustavsson, Erlang/OTP, Ericsson AB



More information about the eeps mailing list