···66// const Stuff = enum(u8){ foo = 16 };
77//
88// You can get the integer out with a builtin function,
99-// @enumToInt(). We'll learn about builtins properly in a later
99+// @intFromEnum(). We'll learn about builtins properly in a later
1010// exercise.
1111//
1212-// const my_stuff: u8 = @enumToInt(Stuff.foo);
1212+// const my_stuff: u8 = @intFromEnum(Stuff.foo);
1313//
1414// Note how that built-in function starts with "@" just like the
1515// @import() function we've been using.
+1-1
exercises/064_builtins.zig
···44// Ziglings exercise.
55//
66// We've also seen @intCast() in "016_for2.zig", "058_quiz7.zig";
77-// and @enumToInt() in "036_enums2.zig".
77+// and @intFromEnum() in "036_enums2.zig".
88//
99// Builtins are special because they are intrinsic to the Zig
1010// language itself (as opposed to being provided in the standard
+4-4
exercises/065_builtins2.zig
···11//
22// Zig has builtins for mathematical operations such as...
33//
44-// @sqrt @sin @cos
55-// @exp @log @floor
44+// @sqrt @sin @cos
55+// @exp @log @floor
66//
77// ...and lots of type casting operations such as...
88//
99-// @as @intToError @intToFloat
1010-// @intToPtr @ptrToInt @enumToInt
99+// @as @errorFromInt @floatFromInt
1010+// @ptrFromInt @intFromPtr @intFromEnum
1111//
1212// Spending part of a rainy day skimming through the complete
1313// list of builtins in the official Zig documentation wouldn't be