From f857bf72e2239718bbbe4cba08d6961ad77fc69a Mon Sep 17 00:00:00 2001 From: Liam Swayne Date: Wed, 18 Dec 2024 00:40:27 -0500 Subject: [PATCH] Add branchHint to `std.math.pow` NaN is an unlikely case, and a branchHint `.unlikely` could be appropriate. --- lib/std/math/pow.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/std/math/pow.zig b/lib/std/math/pow.zig index 7409561e1f6a..e2a4757dbeee 100644 --- a/lib/std/math/pow.zig +++ b/lib/std/math/pow.zig @@ -48,6 +48,7 @@ pub fn pow(comptime T: type, x: T, y: T) T { // pow(nan, y) = nan for all y // pow(x, nan) = nan for all x if (math.isNan(x) or math.isNan(y)) { + @branchHint(.unlikely); return math.nan(T); }