Skip to content

Commit 35191ad

Browse files
authored
Improve argmin/argmax docstring (#46737)
The current phrasing "Return a value `x` in the domain of `f`" is a bit misleading, as the domain of `f` may be much larger than the argument `domain`. It's better to be clear that the value returned will be an element of the `domain` that is provided.
1 parent b1f8d16 commit 35191ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/reduce.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ _findmin(a, ::Colon) = findmin(identity, a)
989989
"""
990990
argmax(f, domain)
991991
992-
Return a value `x` in the domain of `f` for which `f(x)` is maximised.
992+
Return a value `x` from `domain` for which `f(x)` is maximised.
993993
If there are multiple maximal values for `f(x)` then the first one will be found.
994994
995995
`domain` must be a non-empty iterable.
@@ -1041,7 +1041,7 @@ argmax(itr) = findmax(itr)[2]
10411041
"""
10421042
argmin(f, domain)
10431043
1044-
Return a value `x` in the domain of `f` for which `f(x)` is minimised.
1044+
Return a value `x` from `domain` for which `f(x)` is minimised.
10451045
If there are multiple minimal values for `f(x)` then the first one will be found.
10461046
10471047
`domain` must be a non-empty iterable.

0 commit comments

Comments
 (0)