066_comptime.patch 600 B

12345678910111213
  1. --- exercises/066_comptime.zig 2023-10-03 22:15:22.125574535 +0200
  2. +++ answers/066_comptime.zig 2023-10-05 20:04:07.139435109 +0200
  3. @@ -62,8 +62,8 @@
  4. // types with specific sizes. The comptime numbers will be
  5. // coerced (if they'll fit!) into your chosen runtime types.
  6. // For this it is necessary to specify a size, e.g. 32 bit.
  7. - var var_int = 12345;
  8. - var var_float = 987.654;
  9. + var var_int: u32 = 12345;
  10. + var var_float: f32 = 987.654;
  11. // We can change what is stored at the areas set aside for
  12. // "var_int" and "var_float" in the running compiled program.