Skip to content

Commit 19e1b2a

Browse files
committed
Check result of NotNan addition for NaN
1 parent b27bbd4 commit 19e1b2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl<T: Float> Add for NotNaN<T> {
233233
type Output = Self;
234234

235235
fn add(self, other: Self) -> Self {
236-
NotNaN(self.0 + other.0)
236+
NotNaN::new(self.0 + other.0).expect("Adds resulted in NaN")
237237
}
238238
}
239239

0 commit comments

Comments
 (0)