Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f293e89

Browse files
Update weierstrass_method.py
1 parent 057c780 commit f293e89

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)

AltStyle によって変換されたページ (->オリジナル) /