diff options
| author | Chris Boesch <[email protected]> | 2023-06-26 23:43:39 +0200 |
|---|---|---|
| committer | Chris Boesch <[email protected]> | 2023-06-26 23:43:39 +0200 |
| commit | a5a36337e88a15befbb814cdd14a4801e44f6673 (patch) | |
| tree | 026ae50af63d732bb862f8a5b92dbce86af405ea /exercises/096_memory_allocation.zig | |
| parent | c3aed336e70392e33dfebf32489f803bf6736ab9 (diff) | |
| download | ziglings-a5a36337e88a15befbb814cdd14a4801e44f6673.tar.xz ziglings-a5a36337e88a15befbb814cdd14a4801e44f6673.zip | |
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; } } |
