Skip to content

Commit ec42321

Browse files
committed
Deprecate manually vectorized methods for trigonometric and hyperbolic functions in favor of compact broadcast syntax.
1 parent 3a31155 commit ec42321

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

base/deprecated.jl

+7
Original file line numberDiff line numberDiff line change
@@ -1000,4 +1000,11 @@ macro vectorize_2arg(S,f)
10001000
end
10011001
export @vectorize_1arg, @vectorize_2arg
10021002

1003+
# Deprecate manually vectorized trigonometric and hyperbolic functions in favor of compact broadcast syntax
1004+
for f in (:sec, :sech, :secd, :asec, :asech,
1005+
:csc, :csch, :cscd, :acsc, :acsch,
1006+
:cot, :coth, :cotd, :acot, :acoth)
1007+
@eval @deprecate $f{T<:Number}(A::AbstractArray{T}) $f.(A)
1008+
end
1009+
10031010
# End deprecations scheduled for 0.6

base/special/trig.jl

-3
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,6 @@ for (finv, f) in ((:sec, :cos), (:csc, :sin), (:cot, :tan),
311311
(:secd, :cosd), (:cscd, :sind), (:cotd, :tand))
312312
@eval begin
313313
($finv){T<:Number}(z::T) = one(T) / (($f)(z))
314-
($finv){T<:Number}(z::AbstractArray{T}) = one(T) ./ (($f)(z))
315314
end
316315
end
317316

@@ -324,11 +323,9 @@ for (tfa, tfainv, hfa, hfainv, fn) in ((:asec, :acos, :asech, :acosh, "secant"),
324323
@doc """
325324
$($tname)(x)
326325
Compute the inverse $($fn) of `x`, where the output is in radians. """ ($tfa){T<:Number}(y::T) = ($tfainv)(one(T) / y)
327-
($tfa){T<:Number}(y::AbstractArray{T}) = ($tfainv)(one(T) ./ y)
328326
@doc """
329327
$($hname)(x)
330328
Compute the inverse hyperbolic $($fn) of `x`. """ ($hfa){T<:Number}(y::T) = ($hfainv)(one(T) / y)
331-
($hfa){T<:Number}(y::AbstractArray{T}) = ($hfainv)(one(T) ./ y)
332329
end
333330
end
334331

0 commit comments

Comments
 (0)