| author | |
| committer | |
| log | 44f8ce690ddd406fc1a9caa63d9c0741f4afb3a0 |
| tree | bf5dfad2c0a52184f6e1e9ccea51362cf718c9be |
| parent | 8d94dc625b34832af0e85c16fe4d64ee19c2e74e |
The code initializes twice `t` instead of `t1`, leaving the latter
uninitialized. The problem manifested itself by corrupting the LSBs of
the result in unpredictable ways.2 files changed, 2 insertions(+), 2 deletions(-)
lib/std/special/c.zig+1-1| ... | ... | @@ -874,7 +874,7 @@ export fn sqrt(x: f64) f64 { |
| 874 | 874 | |
| 875 | 875 | r = sign; |
| 876 | 876 | while (r != 0) { |
| 877 | t = s1 +% r; | |
| 877 | t1 = s1 +% r; | |
| 878 | 878 | t = s0; |
| 879 | 879 | if (t < ix0 or (t == ix0 and t1 <= ix1)) { |
| 880 | 880 | s1 = t1 +% r; |
test/stage1/behavior/bugs/920.zig+1-1| ... | ... | @@ -60,6 +60,6 @@ test "bug 920 fixed" { |
| 60 | 60 | }; |
| 61 | 61 | |
| 62 | 62 | for (NormalDist1.f) |_, i| { |
| 63 | std.testing.expect(NormalDist1.f[i] == NormalDist.f[i]); | |
| 63 | std.testing.expectEqual(NormalDist1.f[i], NormalDist.f[i]); | |
| 64 | 64 | } |
| 65 | 65 | } |