Skip to content

Commit

Permalink
Improve argmin/argmax docstring (#46737)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jishnub authored Sep 14, 2022
1 parent b1f8d16 commit 35191ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ _findmin(a, ::Colon) = findmin(identity, a)
"""
argmax(f, domain)
Return a value `x` in the domain of `f` for which `f(x)` is maximised.
Return a value `x` from `domain` for which `f(x)` is maximised.
If there are multiple maximal values for `f(x)` then the first one will be found.
`domain` must be a non-empty iterable.
Expand Down Expand Up @@ -1041,7 +1041,7 @@ argmax(itr) = findmax(itr)[2]
"""
argmin(f, domain)
Return a value `x` in the domain of `f` for which `f(x)` is minimised.
Return a value `x` from `domain` for which `f(x)` is minimised.
If there are multiple minimal values for `f(x)` then the first one will be found.
`domain` must be a non-empty iterable.
Expand Down

0 comments on commit 35191ad

Please sign in to comment.