Averages/Arithmetic mean: Difference between revisions

Content added Content deleted
(→‎{{header|OCaml}}: breaking lines too long)
Line 600: Line 600:
the List.fold_left, and for mean_ints it is possible to save calling
the List.fold_left, and for mean_ints it is possible to save calling
float_of_int on every numbers, converting only the result of the addition.
float_of_int on every numbers, converting only the result of the addition.
(also when using List.map and the order is not important, you can use
(also when using List.map and when the order is not important, you can use
List.rev_map instead to save an internal List.rev).
List.rev_map instead to save an internal call to List.rev).
Also the task asks to return 0 on empty lists, but in OCaml this case
Also the task asks to return 0 on empty lists, but in OCaml this case
would rather be handled by an exception.
would rather be handled by an exception.