mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-07-28 18:25:16 +00:00
a03b676bed
Also, start from 1 in the positive direction, instead of 5, since that is more how the thing works (sorry, mathematician brain). Additionally, adds some extra information in the comments: information about how long the code would take if one actually sets count to 2,5 * 10^12, and adding a plus in front of the 4/1 to show that that is in fact the first element of the "plus" side. Finally, add an (floating point) error to the debug print.
13 lines
391 B
Diff
13 lines
391 B
Diff
--- exercises/108_threading2.zig 2026-06-29 23:25:53
|
|
+++ answers/108_threading2.zig 2026-06-29 23:25:25
|
|
@@ -82,7 +82,8 @@
|
|
defer handle1.join();
|
|
|
|
// Second thread to calculate the minus numbers.
|
|
- ???
|
|
+ const handle2 = try std.Thread.spawn(.{}, thread_pi, .{ &pi_minus, 3, count });
|
|
+ defer handle2.join();
|
|
}
|
|
|
|
// Here we add up the results.
|