diff options
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; } } |
