diff options
author | Dave Gauer <dave@ratfactor.com> | 2021-11-07 20:52:39 -0500 |
---|---|---|
committer | Dave Gauer <dave@ratfactor.com> | 2021-11-07 20:52:39 -0500 |
commit | d1e684126176214b65399034c96b6f52189b2b72 (patch) | |
tree | 5866b7f3a15945a73b946443fbd490fc8f4cc2d8 /exercises/066_comptime.zig | |
parent | 266449b1dd8e5e89887aa84c2d10270cdd6c7936 (diff) | |
parent | dedd787f2dd0badc03caa1299adaf57eaeaae156 (diff) | |
download | ziglings-d1e684126176214b65399034c96b6f52189b2b72.tar.gz ziglings-d1e684126176214b65399034c96b6f52189b2b72.tar.bz2 ziglings-d1e684126176214b65399034c96b6f52189b2b72.tar.xz ziglings-d1e684126176214b65399034c96b6f52189b2b72.zip |
Merge branch 'main' of github.com:ratfactor/ziglings into main
Diffstat (limited to 'exercises/066_comptime.zig')
-rw-r--r-- | exercises/066_comptime.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/exercises/066_comptime.zig b/exercises/066_comptime.zig index 987402b..bcd0bc5 100644 --- a/exercises/066_comptime.zig +++ b/exercises/066_comptime.zig @@ -27,10 +27,10 @@ // // Zig takes these concepts further by making these optimizations // an integral part of the language itself! -// +// const print = @import("std").debug.print; -pub fn main() void { +pub fn main() void { // ALL numeric literals in Zig are of type comptime_int or // comptime_float. They are of arbitrary size (as big or // little as you need). @@ -46,7 +46,7 @@ pub fn main() void { const const_int = 12345; const const_float = 987.654; - print("Immutable: {}, {d:.3}; ", .{const_int, const_float}); + print("Immutable: {}, {d:.3}; ", .{ const_int, const_float }); // But something changes when we assign the exact same values // to identifiers mutably with "var". @@ -69,7 +69,7 @@ pub fn main() void { var_int = 54321; var_float = 456.789; - print("Mutable: {}, {d:.3}; ", .{var_int, var_float}); + print("Mutable: {}, {d:.3}; ", .{ var_int, var_float }); // Bonus: Now that we're familiar with Zig's builtins, we can // also inspect the types to see what they are, no guessing |