From 6ad9ac59e7461fa6bd906f7c4feb662509082c17 Mon Sep 17 00:00:00 2001 From: vi Date: Tue, 12 Apr 2022 23:58:04 -0600 Subject: [PATCH] std.math.float: fix f80-backed c_longdouble consts --- lib/std/math/float.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/std/math/float.zig b/lib/std/math/float.zig index 30e2268908..72c7f086ac 100644 --- a/lib/std/math/float.zig +++ b/lib/std/math/float.zig @@ -4,7 +4,7 @@ const expect = std.testing.expect; /// Creates a raw "1.0" mantissa for floating point type T. Used to dedupe f80 logic. fn mantissaOne(comptime T: type) comptime_int { - return if (T == f80) 1 << floatFractionalBits(T) else 0; + return if (@typeInfo(T).Float.bits == 80) 1 << floatFractionalBits(T) else 0; } /// Creates floating point type T from an unbiased exponent and raw mantissa.