Skip to content

Commit 9a18426

Browse files
authoredSep 2, 2022
Update adaptive_newton_cotes_rules.py
1 parent 94ff7db commit 9a18426

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

Diff for: ‎Numerical Integration/adaptive_newton_cotes_rules.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def quad_ancr(f, a, b, order=4, rtol=1e-6, atol=1e-10):
7777
[1] Adaptive Simpson's method, https://en.wikipedia.org/wiki/Adaptive_Simpson%27s_method
7878
[2] Wolfram Mathworld, Newton-Cotes Formulas, https://mathworld.wolfram.com/Newton-CotesFormulas.html
7979
"""
80-
if order not in list(range(2, 14, 2)):
80+
if order not in range(2, 14, 2):
8181
raise ValueError('order argument must be among [2,4,6,8,10,12].')
8282

8383
if type(rtol) is not float:
@@ -99,4 +99,4 @@ def quad_ancr(f, a, b, order=4, rtol=1e-6, atol=1e-10):
9999

100100
fa, fb = f(a), f(b)
101101
m, fm, whole = _quad_ancr_mem(f, a, b, fa, fb, order)
102-
return _quad_ancr(f, a, m, b, fa, fm, fb, whole, order, rtol, atol)
102+
return _quad_ancr(f, a, m, b, fa, fm, fb, whole, order, rtol, atol)

0 commit comments

Comments
 (0)
Please sign in to comment.