mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:24:33 +01:00
Add branchHint to std.math.pow
NaN is an unlikely case, and a branchHint `.unlikely` could be appropriate.
This commit is contained in:
parent
4ae101ca85
commit
f857bf72e2
1 changed files with 1 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue