File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 76
76
@test Float16 (0.5f0 )^ 2 ≈ Float16 (0.5f0 ^ 2 )
77
77
@test sin (f) ≈ sin (2f0 )
78
78
@test log10 (Float16 (100 )) == Float16 (2.0 )
79
+ @test sin (ComplexF16 (f)) ≈ sin (complex (2f0 ))
79
80
80
81
# no domain error is thrown for negative values
81
82
@test cbrt (Float16 (- 1.0 )) == - 1.0
Original file line number Diff line number Diff line change @@ -391,12 +391,18 @@ end
391
391
T != Rational{Int} && @test sind (convert (T,- 0.0 )):: fT === - zero (fT)
392
392
@test sind (convert (T,- 180.0 )):: fT === - zero (fT)
393
393
@test sind (convert (T,- 360.0 )):: fT === - zero (fT)
394
+ if T <: AbstractFloat
395
+ @test isnan (sind (T (NaN )))
396
+ end
394
397
end
395
398
@testset " cosd" begin
396
399
@test cosd (convert (T,90 )):: fT === zero (fT)
397
400
@test cosd (convert (T,270 )):: fT === zero (fT)
398
401
@test cosd (convert (T,- 90 )):: fT === zero (fT)
399
402
@test cosd (convert (T,- 270 )):: fT === zero (fT)
403
+ if T <: AbstractFloat
404
+ @test isnan (cosd (T (NaN )))
405
+ end
400
406
end
401
407
@testset " sincosd" begin
402
408
@test sincosd (convert (T,- 360 )):: fTsc === ( - zero (fT), one (fT) )
407
413
@test sincosd (convert (T, 90 )):: fTsc === ( one (fT), zero (fT) )
408
414
@test sincosd (convert (T, 180 )):: fTsc === ( zero (fT), - one (fT) )
409
415
@test sincosd (convert (T, 270 )):: fTsc === ( - one (fT), zero (fT) )
416
+ if T <: AbstractFloat
417
+ @test_throws DomainError sincosd (T (Inf ))
418
+ @test all (isnan .(sincosd (T (NaN ))))
419
+ end
410
420
end
411
421
412
422
@testset " $name " for (name, (sinpi, cospi)) in (
You can’t perform that action at this time.
0 commit comments