Skip to content

Commit

Permalink
Add half-integers for sinpi and cospi too (JuliaLang#39514)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored and antoine-levitt committed May 9, 2021
1 parent 23fcd94 commit 263e1f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/math.jl
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,12 @@ end
end
end

@testset "half-integer and nan/infs for sincospi" begin
@testset "half-integer and nan/infs for sincospi,sinpi,cospi" begin
@testset for T in (ComplexF32, ComplexF64)
@test sincospi(T(0.5, 0.0)) == (T(1.0,0.0), T(0.0, -0.0))
@test sincospi(T(1.5, 0.0)) == (T(-1.0,0.0), T(0.0, 0.0))
@test sinpi(T(1.5, 1.5)) T(-cosh(3*π/2), 0.0)
@test cospi(T(0.5, 0.5)) T(0.0, -sinh/2))
s, c = sincospi(T(Inf64, 0.0))
@test isnan(real(s)) && imag(s) == zero(real(T))
@test isnan(real(c)) && imag(c) == -zero(real(T))
Expand Down

0 comments on commit 263e1f4

Please sign in to comment.