diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-06-24 16:58:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-24 16:58:19 -0700 |
| commit | 146b79af153bbd5dafda0ba12a040385c7fc58f8 (patch) | |
| tree | 67e3db8b444d65c667e314770fc983a7fc8ba293 /lib/std/math/complex/sqrt.zig | |
| parent | 13853bef0df3c90633021850cc6d6abaeea03282 (diff) | |
| parent | 21ac0beb436f49fe49c6982a872f2dc48e4bea5e (diff) | |
| download | zig-146b79af153bbd5dafda0ba12a040385c7fc58f8.tar.gz zig-146b79af153bbd5dafda0ba12a040385c7fc58f8.zip | |
Merge pull request #16163 from mlugg/feat/builtins-infer-dest-ty
Infer destination type of cast builtins using result type
Diffstat (limited to 'lib/std/math/complex/sqrt.zig')
| -rw-r--r-- | lib/std/math/complex/sqrt.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/math/complex/sqrt.zig b/lib/std/math/complex/sqrt.zig index 456d10aa85..fe2e8e6531 100644 --- a/lib/std/math/complex/sqrt.zig +++ b/lib/std/math/complex/sqrt.zig @@ -58,14 +58,14 @@ fn sqrt32(z: Complex(f32)) Complex(f32) { if (dx >= 0) { const t = @sqrt((dx + math.hypot(f64, dx, dy)) * 0.5); return Complex(f32).init( - @floatCast(f32, t), - @floatCast(f32, dy / (2.0 * t)), + @as(f32, @floatCast(t)), + @as(f32, @floatCast(dy / (2.0 * t))), ); } else { const t = @sqrt((-dx + math.hypot(f64, dx, dy)) * 0.5); return Complex(f32).init( - @floatCast(f32, @fabs(y) / (2.0 * t)), - @floatCast(f32, math.copysign(t, y)), + @as(f32, @floatCast(@fabs(y) / (2.0 * t))), + @as(f32, @floatCast(math.copysign(t, y))), ); } } |
