explain mysterious addition in float minimum/maximum
This commit is contained in:
parent
af78bae565
commit
028c78c6c7
2 changed files with 2 additions and 0 deletions
|
@ -957,6 +957,7 @@ impl f32 {
|
||||||
} else if self == other {
|
} else if self == other {
|
||||||
if self.is_sign_negative() && other.is_sign_positive() { self } else { other }
|
if self.is_sign_negative() && other.is_sign_positive() { self } else { other }
|
||||||
} else {
|
} else {
|
||||||
|
// At least one input is NaN. Use `+` to perform NaN propagation and quieting.
|
||||||
self + other
|
self + other
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -968,6 +968,7 @@ impl f64 {
|
||||||
} else if self == other {
|
} else if self == other {
|
||||||
if self.is_sign_negative() && other.is_sign_positive() { self } else { other }
|
if self.is_sign_negative() && other.is_sign_positive() { self } else { other }
|
||||||
} else {
|
} else {
|
||||||
|
// At least one input is NaN. Use `+` to perform NaN propagation and quieting.
|
||||||
self + other
|
self + other
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue