I do think the help texts just from help() on the two functions is quite
clear:
julia> help(maximum)
INFO: Loading help data...
Base.maximum(itr)
Returns the largest element in a collection.
Base.maximum(A, dims)
Compute the maximum value of an array over the given dimensions.
julia> help(max)
Base.max(x, y, ...)
Return the maximum of the arguments. Operates elementwise over
arrays.
With this text in front of me, I'm not at all surprised at the following
results:
julia> A = [1 2; 3 4]; B = [4 3; 2 1]
2x2 Array{Int64,2}:
4 3
2 1
julia> max(A,B)
2x2 Array{Int64,2}:
4 3
3 4
julia> max(A)
WARNING: max(x) is deprecated, use maximum(x) instead.
in max at deprecated.jl:26
4
julia> c = [0;5]
2-element Array{Int64,1}:
0
5
julia> max(A,c)
ERROR: dimensions must match
in promote_shape at operators.jl:166
On Monday, May 5, 2014 12:14:12 PM UTC+2, Billou Bielour wrote:
>
> I have to say the difference between "max" and "maximum" is pretty much
> unintelligible
> by just looking at the names. I've read the help for both three days ago
> and I already forgot which does what. Maybe "maximum" should be renamed
> "maxoverdims" or something of the sort.
>