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/cosh.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/cosh.zig')
| -rw-r--r-- | lib/std/math/complex/cosh.zig | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/std/math/complex/cosh.zig b/lib/std/math/complex/cosh.zig index b3ffab5175..413279db2d 100644 --- a/lib/std/math/complex/cosh.zig +++ b/lib/std/math/complex/cosh.zig @@ -26,10 +26,10 @@ fn cosh32(z: Complex(f32)) Complex(f32) { const x = z.re; const y = z.im; - const hx = @bitCast(u32, x); + const hx = @as(u32, @bitCast(x)); const ix = hx & 0x7fffffff; - const hy = @bitCast(u32, y); + const hy = @as(u32, @bitCast(y)); const iy = hy & 0x7fffffff; if (ix < 0x7f800000 and iy < 0x7f800000) { @@ -89,14 +89,14 @@ fn cosh64(z: Complex(f64)) Complex(f64) { const x = z.re; const y = z.im; - const fx = @bitCast(u64, x); - const hx = @intCast(u32, fx >> 32); - const lx = @truncate(u32, fx); + const fx = @as(u64, @bitCast(x)); + const hx = @as(u32, @intCast(fx >> 32)); + const lx = @as(u32, @truncate(fx)); const ix = hx & 0x7fffffff; - const fy = @bitCast(u64, y); - const hy = @intCast(u32, fy >> 32); - const ly = @truncate(u32, fy); + const fy = @as(u64, @bitCast(y)); + const hy = @as(u32, @intCast(fy >> 32)); + const ly = @as(u32, @truncate(fy)); const iy = hy & 0x7fffffff; // nearly non-exceptional case where x, y are finite |
