Skip to content

Commit 9bba42e

Browse files
authoredOct 27, 2022
refactor: Indent ... for visual purposes (TheAlgorithms#7744)
1 parent e891509 commit 9bba42e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+134
-134
lines changed
 

‎arithmetic_analysis/bisection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ def bisection(function: Callable[[float], float], a: float, b: float) -> float:
88
1.0000000149011612
99
>>> bisection(lambda x: x ** 3 - 1, 2, 1000)
1010
Traceback (most recent call last):
11-
...
11+
...
1212
ValueError: could not find root in given interval.
1313
>>> bisection(lambda x: x ** 2 - 4 * x + 3, 0, 2)
1414
1.0
1515
>>> bisection(lambda x: x ** 2 - 4 * x + 3, 2, 4)
1616
3.0
1717
>>> bisection(lambda x: x ** 2 - 4 * x + 3, 4, 1000)
1818
Traceback (most recent call last):
19-
...
19+
...
2020
ValueError: could not find root in given interval.
2121
"""
2222
start: float = a

‎arithmetic_analysis/intersection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def intersection(function: Callable[[float], float], x0: float, x1: float) -> fl
1010
0.9999999999954654
1111
>>> intersection(lambda x: x ** 3 - 1, 5, 5)
1212
Traceback (most recent call last):
13-
...
13+
...
1414
ZeroDivisionError: float division by zero, could not find root
1515
>>> intersection(lambda x: x ** 3 - 1, 100, 200)
1616
1.0000000000003888
@@ -24,7 +24,7 @@ def intersection(function: Callable[[float], float], x0: float, x1: float) -> fl
2424
0.0
2525
>>> intersection(math.cos, -math.pi, math.pi)
2626
Traceback (most recent call last):
27-
...
27+
...
2828
ZeroDivisionError: float division by zero, could not find root
2929
"""
3030
x_n: float = x0

0 commit comments

Comments
 (0)
Please sign in to comment.