Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit f081772

Browse files
beetreestgross35
authored andcommitted
Remove an is_nan workaround that is no longer needed
1 parent b1b30ca commit f081772

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/math/support/float_traits.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,7 @@ pub trait Float:
8080
/// represented in multiple different ways. This method returns `true` if two NaNs are
8181
/// compared.
8282
fn eq_repr(self, rhs: Self) -> bool {
83-
let is_nan = |x: Self| -> bool {
84-
// }
85-
// fn is_nan(x: Self) -> bool {
86-
// When using mangled-names, the "real" compiler-builtins might not have the
87-
// necessary builtin (__unordtf2) to test whether `f128` is NaN.
88-
// FIXME(f16_f128): Remove once the nightly toolchain has the __unordtf2 builtin
89-
// x is NaN if all the bits of the exponent are set and the significand is non-0
90-
x.to_bits() & Self::EXP_MASK == Self::EXP_MASK
91-
&& x.to_bits() & Self::SIG_MASK != Self::Int::ZERO
92-
};
93-
if is_nan(self) && is_nan(rhs) { true } else { self.to_bits() == rhs.to_bits() }
83+
if self.is_nan() && rhs.is_nan() { true } else { self.to_bits() == rhs.to_bits() }
9484
}
9585

9686
/// Returns true if the value is NaN.

0 commit comments

Comments
 (0)