Add branchHint to std.math.pow

NaN is an unlikely case, and a branchHint `.unlikely` could be appropriate.
This commit is contained in:
Liam Swayne
2024-12-18 00:40:27 -05:00
committed by Andrew Kelley
parent 4ae101ca85
commit f857bf72e2

View File

@@ -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);
}