Skip to content

Commit

Permalink
explain mysterious addition in float minimum/maximum
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 19, 2023
1 parent af78bae commit 028c78c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ impl f32 {
} else if self == other {
if self.is_sign_negative() && other.is_sign_positive() { self } else { other }
} else {
// At least one input is NaN. Use `+` to perform NaN propagation and quieting.
self + other
}
}
Expand Down
1 change: 1 addition & 0 deletions library/core/src/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,7 @@ impl f64 {
} else if self == other {
if self.is_sign_negative() && other.is_sign_positive() { self } else { other }
} else {
// At least one input is NaN. Use `+` to perform NaN propagation and quieting.
self + other
}
}
Expand Down

0 comments on commit 028c78c

Please sign in to comment.