Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions stdlib/math.affine
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 3 additions & 3 deletions stdlib/testing.affine
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
Loading