tracks/python/exercises/complex-numbers/example.py in trackler-2.2.1.40 vs tracks/python/exercises/complex-numbers/example.py in trackler-2.2.1.41
- old
+ new
@@ -10,11 +10,11 @@
r = self.real + other.real
i = self.imaginary + other.imaginary
return ComplexNumber(r, i)
def mul(self, other):
- r = self.real * other.real
- i = self.imaginary * other.imaginary
+ r = self.real * other.real - self.imaginary * other.imaginary
+ i = self.real * other.imaginary + self.imaginary * other.real
return ComplexNumber(r, i)
def sub(self, other):
r = self.real - other.real
i = self.imaginary - other.imaginary