diff options
Diffstat (limited to 'exercises')
-rw-r--r-- | exercises/026_hello2.zig | 6 | ||||
-rw-r--r-- | exercises/093_hello_c.zig | 4 | ||||
-rw-r--r-- | exercises/094_c_math.zig | 1 |
3 files changed, 6 insertions, 5 deletions
diff --git a/exercises/026_hello2.zig b/exercises/026_hello2.zig index 384cb55..cd59b86 100644 --- a/exercises/026_hello2.zig +++ b/exercises/026_hello2.zig @@ -7,9 +7,9 @@ const std = @import("std"); // Take note that this main() definition now returns "!void" rather // than just "void". Since there's no specific error type, this means -// that Zig will infer the error type. This is appropriate in the -// case of main(), but can make a function harder (function pointers) -// or even impossible to work with (recursion) in some situations. +// that Zig will infer the error type. This is appropriate in the case +// of main(), but can make a function harder (function pointers) or +// even impossible to work with (recursion) in some situations. // // You can find more information at: // https://ziglang.org/documentation/master/#Inferred-Error-Sets diff --git a/exercises/093_hello_c.zig b/exercises/093_hello_c.zig index 80b1cb7..f5ff831 100644 --- a/exercises/093_hello_c.zig +++ b/exercises/093_hello_c.zig @@ -53,8 +53,8 @@ pub fn main() void { // specify a file descriptor i.e. 2 for error console. // // In this exercise we use 'write' to output 17 chars, - // but something is missing... - const c_res = ???write(2, "Hello C from Zig!", 17); + // but something is still missing... + const c_res = write(2, "Hello C from Zig!", 17); // let's see what the result from C is: std.debug.print(" - C result ist {d} chars written.\n", .{c_res}); diff --git a/exercises/094_c_math.zig b/exercises/094_c_math.zig index a8596b7..b8e65a3 100644 --- a/exercises/094_c_math.zig +++ b/exercises/094_c_math.zig @@ -29,5 +29,6 @@ pub fn main() !void { // Here we call the C function 'fmod' to get our normalized angel. const result = c.fmod(angel, circle); + // We use formatters for the desired precision and to truncate the decimal places std.debug.print("The normalized angle of {d: >3.1} degrees is {d: >3.1} degrees.\n", .{ angel, result }); } |