@@ -48,6 +48,7 @@ sprint(show, pNULL)
48
48
49
49
@test map (degree, [pNULL,p0,p1,p2,p3,p4,p5,pN,pR,p1000]) == [0 ,0 ,0 ,1 ,2 ,3 ,4 ,4 ,2 ,999 ]
50
50
51
+ @test polyval (poly (Int[]), 2. ) == 1.
51
52
@test polyval (pN, - .125 ) == 276.9609375
52
53
@test polyval (pNULL, 10 ) == 0
53
54
@test polyval (p0, - 10 ) == 0
@@ -69,6 +70,7 @@ sprint(show, pNULL)
69
70
70
71
@test poly ([- 1 ,- 1 ]) == p3
71
72
@test roots (p0)== roots (p1)== roots (pNULL)== []
73
+ @test roots (Poly ([0 ,1 ,0 ])) == [0. ]
72
74
@test roots (p2) == [- 1 ]
73
75
a_roots = copy (pN. a)
74
76
@test all (map (abs,sort (roots (poly (a_roots))) - sort (a_roots)) .< 1e6 )
@@ -181,6 +183,8 @@ p1[5] = 1
181
183
182
184
p1[:] = 0
183
185
@test p1 ≈ zero (p1)
186
+ @test zero (Poly{Int}) == Poly (Int[])
187
+ @test one (Poly{Int}) == Poly ([1 ])
184
188
p1[:] = [1 ,2 ,1 ,0 ,0 ,1 ]
185
189
@test p1 == Poly ([1 ,2 ,1 ,0 ,0 ,1 ])
186
190
@@ -307,6 +311,9 @@ pint = polyint(p)
307
311
@test isequal (pder, Poly ([NaN ])) # derivative will give Poly([NaN])
308
312
@test isequal (pint, Poly ([NaN ])) # integral will give Poly([NaN])
309
313
314
+ pint = polyint (p, Complex (0. ))
315
+ @test isequal (pint, Poly ([NaN ])) # integral will give Poly([NaN])
316
+
310
317
# # proper conversions in arithmetic with different element-types #94
311
318
p = Poly ([0 ,one (Float64)])
312
319
@test Poly{Complex{Float64}} == typeof (p+ 1im )
0 commit comments