···4545 // conversion of 0.453592 kg to the pound.
4646 const shuttle_weight: f16 = 0.453592 * 4480e3;
47474848- // By default, float values are formatted in scientific
4949- // notation. Try experimenting with '{d}' and '{d:.3}' to see
5050- // how decimal formatting works.
4848+ // By default, float values are formatted in standard decimal
4949+ // notation. Experiment with '{d}' and '{d:.3}' to see how
5050+ // decimal formatting works, or try '{e}' and '{e:.3}' for
5151+ // scientific notation.
5152 print("Shuttle liftoff weight: {d:.0} metric tons\n", .{shuttle_weight / 1e3});
5253}
5354
+4-4
patches/patches/060_floats.patch
···11---- exercises/060_floats.zig 2025-10-03 13:28:03.092371247 +0200
22-+++ answers/060_floats.zig 2025-10-03 13:27:40.842926774 +0200
11+--- exercises/060_floats.zig 2025-10-17 17:58:44.811502880 +0200
22++++ answers/060_floats.zig 2025-10-17 17:57:39.227157388 +0200
33@@ -43,7 +43,7 @@
44 //
55 // We'll convert this weight from pounds to metric units at a
···77- const shuttle_weight: f16 = 0.453592 * 4480e3;
88+ const shuttle_weight: f32 = 0.453592 * 4.480e6;
991010- // By default, float values are formatted in scientific
1111- // notation. Try experimenting with '{d}' and '{d:.3}' to see
1010+ // By default, float values are formatted in standard decimal
1111+ // notation. Experiment with '{d}' and '{d:.3}' to see how