Rollup merge of #115958 - RalfJung:mystery-plus, r=Mark-Simulacrum,notriddle

explain mysterious addition in float minimum/maximum

Thanks to `@programmerjake` for mentioning this.
This commit is contained in:
Guillaume Gomez 2023-09-19 20:23:21 +02:00 committed by GitHub
commit 1b862186a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

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

View File

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