Add branchHint to std.math.pow
NaN is an unlikely case, and a branchHint `.unlikely` could be appropriate.
This commit is contained in:
committed by
Andrew Kelley
parent
4ae101ca85
commit
f857bf72e2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user