Skip to content

Commit 5838a12

Browse files
kshyatttkelman
authored andcommitted
Fix atahn to atanh (#17977)
* Fix atahn to atanh * More tests
1 parent 17e0d2b commit 5838a12

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

base/special/trig.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ end
321321

322322
for (tfa, tfainv, hfa, hfainv, fn) in ((:asec, :acos, :asech, :acosh, "secant"),
323323
(:acsc, :asin, :acsch, :asinh, "cosecant"),
324-
(:acot, :atan, :acoth, :atahn, "cotangent"))
324+
(:acot, :atan, :acoth, :atanh, "cotangent"))
325325
tname = string(tfa)
326326
hname = string(hfa)
327327
@eval begin

test/math.jl

+10
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,16 @@ end
192192
@test exp2(Float16(2.)) exp2(2.)
193193
@test log(e) == 1
194194

195+
#test abstractarray trig fxns
196+
TAA = rand(2,2)
197+
TAA = (TAA + TAA.')/2.
198+
STAA = Symmetric(TAA)
199+
@test full(atanh(STAA)) == atanh(TAA)
200+
@test full(asinh(STAA)) == asinh(TAA)
201+
@test full(acosh(STAA+Symmetric(ones(TAA)))) == acosh(TAA+ones(TAA))
202+
@test full(acsch(STAA+Symmetric(ones(TAA)))) == acsch(TAA+ones(TAA))
203+
@test full(acoth(STAA+Symmetric(ones(TAA)))) == acoth(TAA+ones(TAA))
204+
195205
# check exp2(::Integer) matches exp2(::Float)
196206
for ii in -2048:2048
197207
expected = exp2(float(ii))

0 commit comments

Comments
 (0)