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/016_for2.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/016_for2.zig')
| -rw-r--r-- | exercises/016_for2.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/exercises/016_for2.zig b/exercises/016_for2.zig index 0eda182..6fb7844 100644 --- a/exercises/016_for2.zig +++ b/exercises/016_for2.zig @@ -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; } |
