Fix incorrect division by zero check

This commit is contained in:
Tiffany Bennett 2016-08-14 19:04:29 -04:00
parent aec9dad521
commit 392431631b

View file

@ -340,7 +340,7 @@ impl<'a, 'b> Div<&'b Number> for &'a Number {
type Output = Option<Number>;
fn div(self, other: &Number) -> Self::Output {
if self.0 == zero() {
if other.0 == zero() {
None
} else {
self * &other.invert()