@@ -685,34 +685,30 @@ end
685
685
686
686
687
687
# issue 240
688
- P = Polynomial
689
-
690
- a = P ([0.8457170323029561 , 0.47175077674705257 , 0.9775441940117577 ]);
691
- b = P ([0.5410010714904849 , 0.533604905984294 ]);
692
- d = P ([0.5490673726445683 , 0.15991109487875477 ]);
693
- @test degree (gcd (a* d,b* d)) == 0
694
- @test degree (gcd (a* d, b* d, atol= sqrt (eps ()))) > 0
695
- if VERSION >= v " 1.2.0"
696
- @test degree (gcd (a* d,b* d, method= :noda_sasaki )) == degree (d)
697
- @test degree (gcd (a* d,b* d, method= :numerical )) == degree (d)
698
- end
699
-
700
- l,m,n = (5 ,5 ,5 ) # realiable, though for larger l,m,n only **usually** correct
701
- u,v,w = fromroots .(rand .((l,m,n)))
702
- @test degree (gcd (u* v, u* w, method= :numerical )) == degree (u)
688
+ if VERSION >= v " 1.2.0" # rank with keywords; require_one_based_indexing
703
689
704
- # Example of Zeng
705
- x = variable (P{Float64})
706
- p = (x+ 10 )* (x^ 9 + x^ 8 / 3 + 1 )
707
- q = (x+ 10 )* (x^ 9 + x^ 8 / 7 - 6 // 7 )
690
+ P = Polynomial
708
691
709
- @test degree (gcd (p,q)) == 0
710
- if VERSION >= v " 1.2.0"
692
+ a = P ([0.8457170323029561 , 0.47175077674705257 , 0.9775441940117577 ]);
693
+ b = P ([0.5410010714904849 , 0.533604905984294 ]);
694
+ d = P ([0.5490673726445683 , 0.15991109487875477 ]);
695
+ @test degree (gcd (a* d,b* d)) == 0
696
+ @test degree (gcd (a* d, b* d, atol= sqrt (eps ()))) > 0
697
+ @test degree (gcd (a* d,b* d, method= :noda_sasaki )) == degree (d)
698
+ @test degree (gcd (a* d,b* d, method= :numerical )) == degree (d)
699
+ l,m,n = (5 ,5 ,5 ) # realiable, though for larger l,m,n only **usually** correct
700
+ u,v,w = fromroots .(rand .((l,m,n)))
701
+ @test degree (gcd (u* v, u* w, method= :numerical )) == degree (u)
702
+
703
+ # Example of Zeng
704
+ x = variable (P{Float64})
705
+ p = (x+ 10 )* (x^ 9 + x^ 8 / 3 + 1 )
706
+ q = (x+ 10 )* (x^ 9 + x^ 8 / 7 - 6 // 7 )
707
+
708
+ @test degree (gcd (p,q)) == 0
711
709
(@test degree (gcd (p,q, method= :noda_sasaki )) == 1 )
712
710
@test degree (gcd (p,q, method= :numerical )) == 1
713
- end
714
711
715
- if VERSION >= v " 1.2.0"
716
712
# more bits don't help Euclidean
717
713
x = variable (P{BigFloat})
718
714
p = (x+ 10 )* (x^ 9 + x^ 8 / 3 + 1 )
750
746
q = (x- 1 ) * (x- 2 ) * (x- 4 )
751
747
@test degree (gcd (p,q, method= :numerical )) == 2
752
748
end
753
-
754
- end
755
-
749
+ end
756
750
end
757
751
758
-
759
752
@testset " Showing" begin
760
753
761
754
p = Polynomial {Rational} ([1 , 4 ])
0 commit comments