Skip to content

Commit a797ad5

Browse files
committed
Add tests for NaN arg to sind and cosd as well
1 parent 5323612 commit a797ad5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/math.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,18 @@ end
391391
T != Rational{Int} && @test sind(convert(T,-0.0))::fT === -zero(fT)
392392
@test sind(convert(T,-180.0))::fT === -zero(fT)
393393
@test sind(convert(T,-360.0))::fT === -zero(fT)
394+
if T <: AbstractFloat
395+
@test isnan(sind(T(NaN)))
396+
end
394397
end
395398
@testset "cosd" begin
396399
@test cosd(convert(T,90))::fT === zero(fT)
397400
@test cosd(convert(T,270))::fT === zero(fT)
398401
@test cosd(convert(T,-90))::fT === zero(fT)
399402
@test cosd(convert(T,-270))::fT === zero(fT)
403+
if T <: AbstractFloat
404+
@test isnan(cosd(T(NaN)))
405+
end
400406
end
401407
@testset "sincosd" begin
402408
@test sincosd(convert(T,-360))::fTsc === ( -zero(fT), one(fT) )

0 commit comments

Comments
 (0)