Skip to content

Commit

Permalink
fixed complexnumber
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLeoni committed Nov 24, 2018
1 parent d53bb6b commit a4ccc27
Show file tree
Hide file tree
Showing 3 changed files with 1,809 additions and 9 deletions.
6 changes: 3 additions & 3 deletions exercises/oop/ComplexNumber_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ def log(self, base):
return ComplexNumber(math.log(self.real) / math.log(base), self.phase() / math.log(base))


def isclose(self, c, delta):
""" Returns True if the complex number is within a delta distance from complex number c.
def isclose(self, z, delta):
""" Returns True if the complex number is within a delta distance from complex number z.
"""
#jupman-raise
return math.sqrt((self.real-c.real)**2 + (self.imaginary-c.imaginary)**2) < delta
return math.sqrt((self.real-z.real)**2 + (self.imaginary-z.imaginary)**2) < delta
#/jupman-raise


Expand Down

0 comments on commit a4ccc27

Please sign in to comment.