Cumulative standard deviation: Difference between revisions

Content deleted Content added
m →‎{{header|D}}: whitespace
Line 525: Line 525:


=={{header|OCaml}}==
=={{header|OCaml}}==
<lang ocaml>
<lang ocaml>let sqr x = x *. x

let sqr x = x *. x


let stddev l =
let stddev l =
Line 541: Line 539:
Printf.printf "List: ";
Printf.printf "List: ";
List.iter (Printf.printf "%g ") l;
List.iter (Printf.printf "%g ") l;
Printf.printf "\nStandard deviation: %g\n" (stddev l)
Printf.printf "\nStandard deviation: %g\n" (stddev l)</lang>

</lang>


Sample output:
Sample output: