diff options
author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2023-06-27 00:15:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 00:15:48 +0200 |
commit | 1070fe5b4044b34cf86d9c0b79038cbe2aab637b (patch) | |
tree | 77168cd69915ac3e382b1c640cda2d5162d12c50 /exercises/096_memory_allocation.zig | |
parent | 7ad0f06a07081b0efb37cb3061b013d426e7ab92 (diff) | |
parent | a5a36337e88a15befbb814cdd14a4801e44f6673 (diff) |
Merge pull request #333 from ratfactor/v3853
Revised exercises due to the changes of Zig version 0.11.0-dev.3853
Diffstat (limited to 'exercises/096_memory_allocation.zig')
-rw-r--r-- | exercises/096_memory_allocation.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/exercises/096_memory_allocation.zig b/exercises/096_memory_allocation.zig index 7538ba4..c8d7bf6 100644 --- a/exercises/096_memory_allocation.zig +++ b/exercises/096_memory_allocation.zig @@ -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; } } |