Skip to content

Commit cbd6063

Browse files
authored
Merge pull request #15 from ararslan/aa/no-export
Avoid exporting vectorized functions with deprecation
2 parents ad7f3c3 + 9c7a3a0 commit cbd6063

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/NaNMath.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ for f in (:sin, :cos, :tan, :asin, :acos, :acosh, :atanh, :log, :log2, :log10,
99
($f)(x::Float64) = ccall(($(string(f)),Base.Math.libm), Float64, (Float64,), x)
1010
($f)(x::Float32) = ccall(($(string(f,"f")),Base.Math.libm), Float32, (Float32,), x)
1111
($f)(x::Real) = ($f)(float(x))
12-
Compat.@dep_vectorize_1arg Number $f
12+
if VERSION >= v"0.5.0-dev+4002"
13+
function ($f){T<:Number}(x::AbstractArray{T})
14+
Base.depwarn("$f{T<:Number}(x::AbstractArray{T}) is deprecated, use $f.(x) instead.", $f)
15+
return ($f).(x)
16+
end
17+
else
18+
($f){T<:Number}(x::AbstractArray{T}) = broadcast($f, x)
19+
end
1320
end
1421
end
1522

0 commit comments

Comments
 (0)