We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0d683a1 commit fc9dc0cCopy full SHA for fc9dc0c
src/lib.rs
@@ -99,6 +99,12 @@ impl<T: Float> PartialEq for OrderedFloat<T> {
99
}
100
101
102
+impl<T: Float> PartialEq<T> for OrderedFloat<T> {
103
+ fn eq(&self, other: &T) -> bool {
104
+ self.0 == *other
105
+ }
106
+}
107
+
108
impl<T: Float> Hash for OrderedFloat<T> {
109
fn hash<H: Hasher>(&self, state: &mut H) {
110
if self.is_nan() {
@@ -313,6 +319,12 @@ impl<T: Float> Deref for NotNan<T> {
313
319
314
320
impl<T: Float + PartialEq> Eq for NotNan<T> {}
315
321
322
+impl<T: Float> PartialEq<T> for NotNan<T> {
323
324
325
326
327
316
328
/// Adds two NotNans.
317
329
///
318
330
/// Panics if the computation results in NaN
0 commit comments