@@ -1392,7 +1392,7 @@ end
1392
1392
@test sprint (show, p) == " $P (1.0 + 2.0*x + 3.0*x^2)"
1393
1393
1394
1394
p = P ([1 + 1im , - 2im ])
1395
- @test sprint (show, p) == " $P (1 + im - 2im*x)"
1395
+ @test sprint (show, p) == " $P (( 1 + im) - 2im*x)"
1396
1396
1397
1397
1398
1398
p = P ([1 ,2 ,3 ,1 ]) # leading coefficient of 1
@@ -1402,7 +1402,7 @@ end
1402
1402
p = P ([1 , im])
1403
1403
@test repr (p) == " $P (1 + im*x)"
1404
1404
p = P ([1 + im, 1 - im, - 1 + im, - 1 - im])# minus signs
1405
- @test repr (p) == " $P (1 + im + (1 - im)x - (1 - im)x^2 - (1 + im)x^3)"
1405
+ @test repr (p) == " $P (( 1 + im) + (1 - im)x - (1 - im)x^2 - (1 + im)x^3)"
1406
1406
p = P ([1.0 , 0 + NaN * im, NaN , Inf , 0 - Inf * im]) # handle NaN or Inf appropriately
1407
1407
@test repr (p) == " $P (1.0 + NaN*im*x + NaN*x^2 + Inf*x^3 - Inf*im*x^4)"
1408
1408
@@ -1412,13 +1412,13 @@ end
1412
1412
p = P ([1 // 2 , 2 // 3 , 1 ])
1413
1413
@test repr (" text/latex" , p) == " \$\\ frac{1}{2} + \\ frac{2}{3}\\ cdot x + x^{2}\$ "
1414
1414
p = P ([complex (1 ,1 ),complex (0 ,1 ),complex (1 ,0 ),complex (1 ,1 )])
1415
- @test repr (" text/latex" , p) == " \$ 1 + i + i\\ cdot x + x^{2} + (1 + i)x^{3}\$ "
1415
+ @test repr (" text/latex" , p) == " \$ ( 1 + i) + i\\ cdot x + x^{2} + (1 + i)x^{3}\$ "
1416
1416
1417
1417
@test printpoly_to_string (P ([1 ,2 ,3 ], " y" )) == " 1 + 2*y + 3*y^2"
1418
1418
@test printpoly_to_string (P ([1 ,2 ,3 ], " y" ), descending_powers = true ) == " 3*y^2 + 2*y + 1"
1419
1419
@test printpoly_to_string (P ([2 , 3 , 1 ], :z ), descending_powers = true , offset = - 2 ) == " 1 + 3*z^-1 + 2*z^-2"
1420
1420
@test printpoly_to_string (P ([- 1 , 0 , 1 ], :z ), offset = - 1 , descending_powers = true ) == " z - z^-1"
1421
- @test printpoly_to_string (P ([complex (1 ,1 ),complex (1 ,- 1 )]),MIME " text/latex" ()) == " 1 + i + (1 - i)x"
1421
+ @test printpoly_to_string (P ([complex (1 ,1 ),complex (1 ,- 1 )]),MIME " text/latex" ()) == " ( 1 + i) + (1 - i)x"
1422
1422
end
1423
1423
1424
1424
# # closed issues
@@ -1428,7 +1428,7 @@ end
1428
1428
io= IOBuffer (); printpoly (io, p, compact= true , mulsymbol= " " ); @test String (take! (io)) == " 1.23457 + 2.34568x"
1429
1429
1430
1430
# # issue 278 with complex
1431
- @test printpoly_to_string (Polynomial ([1 + im, 1 , 2 , im, 2im , 1 + im, 1 - im])) == " 1 + im + x + 2*x^2 + im*x^3 + 2im*x^4 + (1 + im)x^5 + (1 - im)x^6"
1431
+ @test printpoly_to_string (Polynomial ([1 + im, 1 , 2 , im, 2im , 1 + im, 1 - im])) == " ( 1 + im) + x + 2*x^2 + im*x^3 + 2im*x^4 + (1 + im)x^5 + (1 - im)x^6"
1432
1432
1433
1433
# # issue #320 (fix was broken)
1434
1434
@test printpoly_to_string (Polynomial (BigInt[1 ,0 ,1 ], :y )) == " 1 + y^2"
0 commit comments