Skip to content

Commit 24923ee

Browse files
authored
Add doctest to maths/numerical_analysis/intersection.py (#12148)
1 parent 2ca96b7 commit 24923ee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: maths/numerical_analysis/intersection.py

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ def intersection(function: Callable[[float], float], x0: float, x1: float) -> fl
4242

4343

4444
def f(x: float) -> float:
45+
"""
46+
function is f(x) = x^3 - 2x - 5
47+
>>> f(2)
48+
-1.0
49+
"""
4550
return math.pow(x, 3) - (2 * x) - 5
4651

4752

0 commit comments

Comments
 (0)