From 5838a12ba037f40b31affe5b408edcf9ce4bed28 Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Fri, 12 Aug 2016 00:40:50 -0700 Subject: [PATCH] Fix atahn to atanh (#17977) * Fix atahn to atanh * More tests --- base/special/trig.jl | 2 +- test/math.jl | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/base/special/trig.jl b/base/special/trig.jl index 2ad94211c590f..4a4e0b94170a7 100644 --- a/base/special/trig.jl +++ b/base/special/trig.jl @@ -321,7 +321,7 @@ end for (tfa, tfainv, hfa, hfainv, fn) in ((:asec, :acos, :asech, :acosh, "secant"), (:acsc, :asin, :acsch, :asinh, "cosecant"), - (:acot, :atan, :acoth, :atahn, "cotangent")) + (:acot, :atan, :acoth, :atanh, "cotangent")) tname = string(tfa) hname = string(hfa) @eval begin diff --git a/test/math.jl b/test/math.jl index 2394bd460e4ea..26a744b3211f0 100644 --- a/test/math.jl +++ b/test/math.jl @@ -192,6 +192,16 @@ end @test exp2(Float16(2.)) ≈ exp2(2.) @test log(e) == 1 +#test abstractarray trig fxns +TAA = rand(2,2) +TAA = (TAA + TAA.')/2. +STAA = Symmetric(TAA) +@test full(atanh(STAA)) == atanh(TAA) +@test full(asinh(STAA)) == asinh(TAA) +@test full(acosh(STAA+Symmetric(ones(TAA)))) == acosh(TAA+ones(TAA)) +@test full(acsch(STAA+Symmetric(ones(TAA)))) == acsch(TAA+ones(TAA)) +@test full(acoth(STAA+Symmetric(ones(TAA)))) == acoth(TAA+ones(TAA)) + # check exp2(::Integer) matches exp2(::Float) for ii in -2048:2048 expected = exp2(float(ii))