Revised exercises due to the changes of Zig version 0.11.0-dev.3853

This commit is contained in:
Chris Boesch 2023-06-26 23:43:39 +02:00
parent a57926bef2
commit a0a9920b78
11 changed files with 16 additions and 13 deletions

View file

@ -45,7 +45,8 @@ fn runningAverage(arr: []const f64, avg: []f64) void {
for (0.., arr) |index, val| {
sum += val;
avg[index] = sum / @floatFromInt(f64, index + 1);
const f_index: f64 = @floatFromInt(index + 1);
avg[index] = sum / f_index;
}
}