Skip to content

Commit 70c4ea5

Browse files
Update weierstrass_method.py
1 parent d1b704e commit 70c4ea5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

maths/numerical_analysis/weierstrass_method.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ def weierstrass_method(
3636
... roots = weierstrass_method(poly, degree)
3737
... return np.allclose(np.sort(roots), np.sort(expected))
3838
39-
>>> check(lambda x: x**2 - 1, 2, np.array([-1, 1]))
39+
>>> check(
40+
... lambda x: x**2 - 1,
41+
... 2,
42+
... np.array([-1, 1]))
4043
True
4144
42-
>>> check(lambda x: x**3 - 4.5*x**2 + 5.75*x - 1.875, 3, np.array([1.5, 0.5, 2.5]))
45+
>>> check(
46+
... lambda x: x**3 - 4.5*x**2 + 5.75*x - 1.875,
47+
... 3,
48+
... np.array([1.5, 0.5, 2.5])
49+
... )
4350
True
4451
4552
See Also:

0 commit comments

Comments
 (0)