Skip to content

Commit

Permalink
Rollup merge of rust-lang#115958 - RalfJung:mystery-plus, r=Mark-Simu…
Browse files Browse the repository at this point in the history
…lacrum,notriddle

explain mysterious addition in float minimum/maximum

Thanks to `@programmerjake` for mentioning this.
  • Loading branch information
GuillaumeGomez authored Sep 19, 2023
2 parents c5f215a + 028c78c commit 1b86218
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 1b86218

Please sign in to comment.