Revised exercises due to the changes of Zig version 0.11.0-dev.3853
This commit is contained in:
parent
a57926bef2
commit
a0a9920b78
11 changed files with 16 additions and 13 deletions
|
|
@ -29,7 +29,8 @@ pub fn main() void {
|
|||
// Note that we convert the usize i to a u32 with
|
||||
// @intCast(), a builtin function just like @import().
|
||||
// We'll learn about these properly in a later exercise.
|
||||
const place_value = std.math.pow(u32, 2, @intCast(u32, i));
|
||||
const i_u32: u32 = @intCast(i);
|
||||
const place_value = std.math.pow(u32, 2, i_u32);
|
||||
value += place_value * bit;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue