aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math/complex/sqrt.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-06-24 16:58:19 -0700
committerGitHub <noreply@github.com>2023-06-24 16:58:19 -0700
commit146b79af153bbd5dafda0ba12a040385c7fc58f8 (patch)
tree67e3db8b444d65c667e314770fc983a7fc8ba293 /lib/std/math/complex/sqrt.zig
parent13853bef0df3c90633021850cc6d6abaeea03282 (diff)
parent21ac0beb436f49fe49c6982a872f2dc48e4bea5e (diff)
downloadzig-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.zig8
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))),
);
}
}