diff --git a/base/deprecated.jl b/base/deprecated.jl index 02781b4948114..10f7a3a90cf64 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -1168,4 +1168,11 @@ for (dep, f, op) in [(:sumabs!, :sum!, :abs), end end +# Deprecate manually vectorized trigonometric and hyperbolic functions in favor of compact broadcast syntax +for f in (:sec, :sech, :secd, :asec, :asech, + :csc, :csch, :cscd, :acsc, :acsch, + :cot, :coth, :cotd, :acot, :acoth) + @eval @deprecate $f{T<:Number}(A::AbstractArray{T}) $f.(A) +end + # End deprecations scheduled for 0.6 diff --git a/base/special/trig.jl b/base/special/trig.jl index bc84f2b972554..291503aec000c 100644 --- a/base/special/trig.jl +++ b/base/special/trig.jl @@ -311,7 +311,6 @@ for (finv, f) in ((:sec, :cos), (:csc, :sin), (:cot, :tan), (:secd, :cosd), (:cscd, :sind), (:cotd, :tand)) @eval begin ($finv){T<:Number}(z::T) = one(T) / (($f)(z)) - ($finv){T<:Number}(z::AbstractArray{T}) = one(T) ./ (($f)(z)) end end @@ -324,11 +323,9 @@ for (tfa, tfainv, hfa, hfainv, fn) in ((:asec, :acos, :asech, :acosh, "secant"), @doc """ $($tname)(x) Compute the inverse $($fn) of `x`, where the output is in radians. """ ($tfa){T<:Number}(y::T) = ($tfainv)(one(T) / y) - ($tfa){T<:Number}(y::AbstractArray{T}) = ($tfainv)(one(T) ./ y) @doc """ $($hname)(x) Compute the inverse hyperbolic $($fn) of `x`. """ ($hfa){T<:Number}(y::T) = ($hfainv)(one(T) / y) - ($hfa){T<:Number}(y::AbstractArray{T}) = ($hfainv)(one(T) ./ y) end end