mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-11-08 11:20:46 -05:00
Update outdated comments
This commit is contained in:
parent
3e502fe69b
commit
d52f360731
3 changed files with 7 additions and 7 deletions
|
@ -6,10 +6,10 @@
|
|||
// const Stuff = enum(u8){ foo = 16 };
|
||||
//
|
||||
// You can get the integer out with a builtin function,
|
||||
// @enumToInt(). We'll learn about builtins properly in a later
|
||||
// @intFromEnum(). We'll learn about builtins properly in a later
|
||||
// exercise.
|
||||
//
|
||||
// const my_stuff: u8 = @enumToInt(Stuff.foo);
|
||||
// const my_stuff: u8 = @intFromEnum(Stuff.foo);
|
||||
//
|
||||
// Note how that built-in function starts with "@" just like the
|
||||
// @import() function we've been using.
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
// Ziglings exercise.
|
||||
//
|
||||
// We've also seen @intCast() in "016_for2.zig", "058_quiz7.zig";
|
||||
// and @enumToInt() in "036_enums2.zig".
|
||||
// and @intFromEnum() in "036_enums2.zig".
|
||||
//
|
||||
// Builtins are special because they are intrinsic to the Zig
|
||||
// language itself (as opposed to being provided in the standard
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
//
|
||||
// Zig has builtins for mathematical operations such as...
|
||||
//
|
||||
// @sqrt @sin @cos
|
||||
// @exp @log @floor
|
||||
// @sqrt @sin @cos
|
||||
// @exp @log @floor
|
||||
//
|
||||
// ...and lots of type casting operations such as...
|
||||
//
|
||||
// @as @intToError @intToFloat
|
||||
// @intToPtr @ptrToInt @enumToInt
|
||||
// @as @errorFromInt @floatFromInt
|
||||
// @ptrFromInt @intFromPtr @intFromEnum
|
||||
//
|
||||
// Spending part of a rainy day skimming through the complete
|
||||
// list of builtins in the official Zig documentation wouldn't be
|
||||
|
|
Loading…
Reference in a new issue