From 21c2c511204bf0b1339c33221cd2d5ea95243e9a Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Tue, 10 Nov 2020 03:29:00 -0500 Subject: [PATCH] Missing tests for hyperbolic trig fallbacks (#38367) --- test/math.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/math.jl b/test/math.jl index eaf782334c213..6aa94aa96197f 100644 --- a/test/math.jl +++ b/test/math.jl @@ -1076,6 +1076,19 @@ float(x::FloatWrapper) = x @test isa(cos(z), Complex) end +# Define simple wrapper of a Float type: +struct FloatWrapper2 <: Real + x::Float64 +end + +float(x::FloatWrapper2) = x.x +@testset "inverse hyperbolic trig functions of non-standard float" begin + x = FloatWrapper2(3.1) + @test asinh(sinh(x)) == asinh(sinh(3.1)) + @test acosh(cosh(x)) == acosh(cosh(3.1)) + @test atanh(tanh(x)) == atanh(tanh(3.1)) +end + @testset "cbrt" begin for T in (Float32, Float64) @test cbrt(zero(T)) === zero(T)