Merge branch 'main' into refactor-var-to-const
This commit is contained in:
commit
973625552a
5 changed files with 10 additions and 9 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue