explain mysterious addition in float minimum/maximum
This commit is contained in:
parent
af78bae565
commit
028c78c6c7
@ -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…
x
Reference in New Issue
Block a user