Skip to content

Commit 1b86218

Browse files
Rollup merge of rust-lang#115958 - RalfJung:mystery-plus, r=Mark-Simulacrum,notriddle
explain mysterious addition in float minimum/maximum Thanks to `@programmerjake` for mentioning this.
2 parents c5f215a + 028c78c commit 1b86218

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

library/core/src/num/f32.rs

+1
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ impl f32 {
957957
} else if self == other {
958958
if self.is_sign_negative() && other.is_sign_positive() { self } else { other }
959959
} else {
960+
// At least one input is NaN. Use `+` to perform NaN propagation and quieting.
960961
self + other
961962
}
962963
}

library/core/src/num/f64.rs

+1
Original file line numberDiff line numberDiff line change
@@ -968,6 +968,7 @@ impl f64 {
968968
} else if self == other {
969969
if self.is_sign_negative() && other.is_sign_positive() { self } else { other }
970970
} else {
971+
// At least one input is NaN. Use `+` to perform NaN propagation and quieting.
971972
self + other
972973
}
973974
}

0 commit comments

Comments
 (0)