pub fn sum(arr: &mut Array) -> Result<Dynamic, Box<EvalAltResult>>Expand description
Sum an array. Fails if the input is not an array, or if it is an array with elements other than INT or FLOAT.
let data = [1, 2, 3];
let m = sum(data);
assert_eq(m, 6);let data = [1, 2.0, 3];
let m = sum(data);
assert_eq(m, 6.0);