mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-08 07:50:00 +00:00
Merge branch 'main' into refactor-var-to-const
This commit is contained in:
@@ -57,8 +57,8 @@ pub fn main() void {
|
||||
\\</p>
|
||||
\\
|
||||
, .{
|
||||
@enumToInt(Color.red),
|
||||
@enumToInt(Color.green),
|
||||
@enumToInt(???), // Oops! We're missing something!
|
||||
@intFromEnum(Color.red),
|
||||
@intFromEnum(Color.green),
|
||||
@intFromEnum(???), // Oops! We're missing something!
|
||||
});
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ fn runningAverage(arr: []const f64, avg: []f64) void {
|
||||
|
||||
for (0.., arr) |index, val| {
|
||||
sum += val;
|
||||
avg[index] = sum / @intToFloat(f64, index + 1);
|
||||
avg[index] = sum / @floatFromInt(f64, index + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user