Averages/Arithmetic mean: Difference between revisions

→‎{{header|OCaml}}: breaking lines too long
(→‎{{header|OCaml}}: s/which/wish/)
(→‎{{header|OCaml}}: breaking lines too long)
Line 589:
These functions return a float:
 
<lang ocaml>let mean_floats = function [] -> 0. | xs -> List.fold_left (+.) 0. xs /. float_of_int (List.length xs)
| [] -> 0.
| xs -> List.fold_left (+.) 0. xs /. float_of_int (List.length xs)
 
let mean_ints xs = mean_floats (List.map float_of_int xs)</lang>
Anonymous user