Skip to content

Commit

Permalink
Missing tests for hyperbolic trig fallbacks (#38367)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored Nov 10, 2020
1 parent 5488015 commit 21c2c51
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 21c2c51

Please sign in to comment.