@@ -421,6 +421,23 @@ fit(Poly, xx,yy,2)
421
421
# # Issue with overflow and polyder Issue #159
422
422
@test ! iszero (polyder (Poly (BigInt[0 , 1 ])^ 100 , 100 ))
423
423
424
+ @testset " `all` and `any`" begin
425
+ @test all (x -> x > 1 , Polynomial ([2 // 1 , 3 , Int8 (4 ), 5.0 ]))
426
+ @test any (x -> x > 1 , Polynomial ([2 // 1 , 3 , Int8 (4 ), 5.0 ]))
427
+ @test any (isnan, Polynomial ([2 // 1 , NaN , Int8 (4 ), 5.0 ]))
428
+ @test any (! isfinite, Polynomial ([2 // 1 , NaN , Int8 (4 ), 5.0 ]))
429
+ @test any (isinf, Polynomial ([2 // 1 , Inf64 , Int8 (4 ), 5.0 ]))
430
+ @test any (iszero, Polynomial ([1 , 0 , 2.0 , 3 // 1 ]))
431
+ end
432
+
433
+ @testset " `map`" begin
434
+ @test map (sqrt, Polynomial ([1 , 2 , 3 , 4.0 ])) == Polynomial ([√ 1 , √ 2 , √ 3 , √ 4 ])
435
+ @test map (x -> x + 1 , Polynomial ([1 , 2 , 3 , 4.0 ])) == Polynomial ([2 , 3 , 4.0 , 5 // 1 ])
436
+ @test map (zero, Polynomial ([1 , 2 , 3 , 4.0 ])) == Polynomial (0 )
437
+ @test map (one, Polynomial ([1 , 2 , 3 , 4.0 ])) == Polynomial ([1 , 1 , 1 , 1 ])
438
+ @test map (float, Polynomial ([1 , 2 , 3 , 4 ])) == Polynomial ([1.0 , 2.0 , 3.0 , 4.0 ])
439
+ end
440
+
424
441
@testset " `isreal` and `real`" begin
425
442
x = Polynomial ([1 // 2 , 2 + 0im , 3.0 , 4.0 + 0.0im ])
426
443
y = Polynomial ([1 // 2 , 2 + 0im , 3.0 , 4.0 + 0.1im ])
0 commit comments