diff options
Diffstat (limited to 'impl/Complete.hpp')
-rw-r--r-- | impl/Complete.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/impl/Complete.hpp b/impl/Complete.hpp index 11f2f83..997fb6e 100644 --- a/impl/Complete.hpp +++ b/impl/Complete.hpp @@ -33,6 +33,9 @@ struct Complete { Complete& operator-=(const Complete& other) { return (*this) = (*this) - other; } + Complete& operator*=(const Complete& other) { + return (*this) = (*this) * other; + } Complete operator-() const { return Complete<T>(- _value, _infinity); @@ -50,13 +53,7 @@ struct Complete { return *this + (- other); } Complete operator*(const Complete& other) const { - if (_infinity) { - return *this; - } else if (other._infinity) { - return other; - } else { - return Complete(_value + other._value, false); - } + return Complete(_value * other._value, (_infinity || other._infinity)); } bool operator!() const { |