variable arg numbers for Base methods

This commit is contained in:
Michael K. Borregaard 2017-05-25 12:05:21 +02:00
parent 8d21cdec0c
commit 132b5176fe

View File

@ -109,7 +109,7 @@ export
import NaNMath import NaNMath
# define functions (e.g. `_extrema`, that uses the NaNMath version (which ignores NaNs)) when the type is applicable # define functions (e.g. `_extrema`, that uses the NaNMath version (which ignores NaNs)) when the type is applicable
for fun in (:extrema, :minimum, :maximum, :mean) for fun in (:extrema, :minimum, :maximum, :mean)
@eval $(Symbol(string("_",fun)))(x) = Base.$(fun)(x) @eval $(Symbol(string("_",fun)))(x...) = Base.$(fun)(x...)
@eval $(Symbol(string("_",fun))){F <: AbstractFloat}(x::AbstractVector{F}) = NaNMath.$(fun)(x) @eval $(Symbol(string("_",fun))){F <: AbstractFloat}(x::AbstractVector{F}) = NaNMath.$(fun)(x)
end end