diff --git a/stdlib/math.affine b/stdlib/math.affine index 24270f0c..d3b65c55 100644 --- a/stdlib/math.affine +++ b/stdlib/math.affine @@ -351,18 +351,18 @@ fn mean(values: [Float]) -> Float { if n == 0 { return 0.0; } - let total = 0.0; + let mut tot = 0.0; for v in values { - total = total + v; + tot = tot + v; } - total / to_float(n) + tot / to_float(n) } /// Sum of a list of floats fn sum_float(values: [Float]) -> Float { - let total = 0.0; + let mut tot = 0.0; for v in values { - total = total + v; + tot = tot + v; } - total + tot } diff --git a/stdlib/testing.affine b/stdlib/testing.affine index daecd88f..14b00759 100644 --- a/stdlib/testing.affine +++ b/stdlib/testing.affine @@ -299,11 +299,11 @@ fn bench(f: () -> (), iterations: Int) -> BenchResult { i = i + 1; } - let total = time_now() - start; + let tot = time_now() - start; { iterations: iterations, - total_time: total, - avg_time: total / (iterations + 0.0) + total_time: tot, + avg_time: tot / (iterations + 0.0) } }