Skip to content

Commit a520e73

Browse files
committed
FIX: DOC: Fix Examples section in brent_max
1 parent 5928e7a commit a520e73

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

quantecon/optimize/scalar_maximization.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,13 @@ def brent_max(func, a, b, args=(), xtol=1e-5, maxiter=500):
3737
attained. A value of 0 implies that the maximum was not hit.
3838
The value `num_iter` is the number of function calls.
3939
40-
Example
41-
-------
42-
43-
```
44-
@njit
45-
def f(x):
46-
return -(x + 2.0)**2 + 1.0
47-
48-
xf, fval, info = brent_max(f, -2, 2)
49-
```
40+
Examples
41+
--------
42+
>>> @njit
43+
... def f(x):
44+
... return -(x + 2.0)**2 + 1.0
45+
...
46+
>>> xf, fval, info = brent_max(f, -2, 2)
5047
5148
"""
5249
if not np.isfinite(a):

0 commit comments

Comments
 (0)