Skip to content

Commit

Permalink
Changed signature of horner to make it consistent with numpy's implem…
Browse files Browse the repository at this point in the history
…entation
  • Loading branch information
nbro committed Sep 30, 2017
1 parent 2251951 commit aa301e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ands/algorithms/numerical/horner.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
__all__ = ["horner"]


def horner(coefficients: list, x0: float) -> float:
def horner(x0: float, coefficients: list) -> float:
"""A function that implements the Horner's method for evaluating a
polynomial, with coefficients, at x = x0.
Expand Down
2 changes: 1 addition & 1 deletion tests/algorithms/numerical/test_horner.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ def setUp(self):
self.coefficients = [uniform(-10, 10) for _ in range(self.degree + 1)]

def test_one(self):
self.assertEqual(horner(self.coefficients, self.x0),
self.assertEqual(horner(self.x0, self.coefficients),
polyval(self.x0, self.coefficients))

0 comments on commit aa301e5

Please sign in to comment.