From f26dda21171e26f44aeec8c59a75bbb3331eeb2e Mon Sep 17 00:00:00 2001 From: mlugg Date: Thu, 22 Jun 2023 18:46:56 +0100 Subject: all: migrate code to new cast builtin syntax Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change --- lib/std/math/complex/sqrt.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/std/math/complex/sqrt.zig') 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))), ); } } -- cgit v1.2.3