Skip to content

Commit

Permalink
Merge pull request #15 from ararslan/aa/no-export
Browse files Browse the repository at this point in the history
Avoid exporting vectorized functions with deprecation
  • Loading branch information
mlubin authored Mar 24, 2017
2 parents ad7f3c3 + 9c7a3a0 commit cbd6063
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/NaNMath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ for f in (:sin, :cos, :tan, :asin, :acos, :acosh, :atanh, :log, :log2, :log10,
($f)(x::Float64) = ccall(($(string(f)),Base.Math.libm), Float64, (Float64,), x)
($f)(x::Float32) = ccall(($(string(f,"f")),Base.Math.libm), Float32, (Float32,), x)
($f)(x::Real) = ($f)(float(x))
Compat.@dep_vectorize_1arg Number $f
if VERSION >= v"0.5.0-dev+4002"
function ($f){T<:Number}(x::AbstractArray{T})
Base.depwarn("$f{T<:Number}(x::AbstractArray{T}) is deprecated, use $f.(x) instead.", $f)
return ($f).(x)
end
else
($f){T<:Number}(x::AbstractArray{T}) = broadcast($f, x)
end
end
end

Expand Down

0 comments on commit cbd6063

Please sign in to comment.