[erlang-questions] Erlang/YAWS vs Free Pascal/Xitami
Jilani Khaldi
jilani@REDACTED
Tue Mar 25 12:03:34 CET 2008
> ....which gives us:
>
> var_dev(V) ->
> Len = length(V),
> Media = lists:sum(V) / Len,
> D = [X-Media || X <- V],
> Q = [X*X || X <-D],
> S = lists:sum(Q),
> Var = S / Len,
> Dev = math:sqrt(Var),
> {Media, D, Q, S, Var, Dev}.
>
> out(A) ->
> Z=lists:seq(1,1000),
> {Media, D, Q, S, Var, Dev} = var_dev(Z),
> T=io_lib:format("Std Dev: ~.6f ", [Dev]),
> {html, T}.
Thank you Ulf! I just have updated the article adding your code and the
results for 10000 connections.
--
***
Jilani KHALDI
http://www.dotpas.org
More information about the erlang-questions
mailing list