gap> 
gap> 
gap> # Start
gap> 
gap> START_TEST( "Test of the 'if' package" );
gap> SizeScreen([80]);;
gap> 
gap> 
gap> IF_Interface(IF_pari_gp, "gcd", [1000,360] );
40
gap> 
gap> 
gap> 
gap> # t_INT
gap> 
gap> IF_Interface(IF_pari_gp, "omega", [360]);
3
gap> IF_Interface(IF_pari_gp, "nextprime", [119] );
127
gap> x:=-10^5000;; x=IF_Interface( IF_pari_gp, "", [x] );
true
gap> 0=IF_Interface( IF_pari_gp, "", [0] );
true
gap> IF_Interface( IF_pari_gp, "bestappr", [333/106,10] );
22/7
gap> 
gap> 
gap> # t_REAL
gap> 
gap> IF_Interface(IF_pari_gp, "sin", [8] );
"0.9893582466233817778081235982"
gap> 
gap> 
gap> # t_INTMOD
gap> 
gap> IF_Interface(IF_pari_gp, "", [ZmodnZObj(8,3)]);
ZmodpZObj( 2, 3 )
gap> IF_Interface( IF_pari_gp, "Mod", [11,7] );
ZmodpZObj( 4, 7 )
gap> 
gap> 
gap> # t_FRAC
gap> 
gap> IF_Interface(IF_pari_gp, "", [111/23]);
111/23
gap> 
gap> 
gap> # t_FRACN
gap> 
gap> IF_Interface(IF_pari_gp, "type", [6/4, "t_FRACN"] );
3/2
gap> 
gap> 
gap> # t_COMPLEX
gap> 
gap> IF_Interface(IF_pari_gp, "", [E(4)]);
E(4)
gap> IF_Interface(IF_pari_gp, "", [23/34+E(4)*45/67]);
23/34+45/67*E(4)
gap> IF_Interface(IF_pari_gp, "conj", [23/34+E(4)*45/67]);
23/34-45/67*E(4)
gap> 
gap> 
gap> # t_PADIC
gap> 
gap> fam:=PurePadicNumberFamily(2,7);;
gap> a:=PadicNumber(fam,3/5);
1.110011(2)
gap> IF_Interface(IF_pari_gp, "", [a]);
1.110011(2)
gap> 
gap> 
gap> # t_QUAD
gap> 
gap> 
gap> # t_POLMOD
gap> 
gap> 
gap> # t_POL
gap> 
gap> x_1:=Indeterminate(Rationals);;
gap> IF_Interface(IF_pari_gp, "polcoeff", [44*x_1^3+33*x_1^2+22*x_1+11,2]);
33
gap> IF_Interface(IF_pari_gp, "", [ 13*x_1^3 + 12*x_1^2 + 11*x_1 + 10]) = 13*x_1^3 + 12*x_1^2 + 11*x_1 + 10;
true
gap> IF_Interface( IF_pari_gp, "factor", [x_1^3+3*x_1^2+3*x_1+1] ) = [[x_1+1,3]];
true
gap> 
gap> 
gap> x:=Indeterminate(Rationals);;
gap> y:=Indeterminate(Rationals,[x]);;
gap> IF_Interface(IF_pari_gp, "", [11*x^3*y^4+12*x*y+13*x^2*y+14]) = 11*x^3*y^4+12*x*y+13*x^2*y+14;
true
gap> IF_Interface(IF_pari_gp,"polgalois",[x^4+x*x+5]);
[ 8, -1, 1 ]
gap> 
gap> IF_Interface(IF_pari_gp,"algdep",[E(4),3]); # <------------------- could change
x^2+1
gap> 
gap> 
gap> # t_SER
gap> 
gap> 
gap> # t_RFRAC
gap> 
gap> IF_Interface(IF_pari_gp, "", [(33*x_1^2+22*x_1+11)/(x_1+x_1^5)]) = (33*x_1^2+22*x_1+11)/(x_1+x_1^5);
true
gap> IF_Interface(IF_pari_gp,"intformal",[1/(x^2)])= -1/x;
true
gap> 
gap> 
gap> # t_RFRACN
gap> 
gap> IF_Interface(IF_pari_gp, "type", [(33*x_1^2+22*x_1+11)/(x_1+x_1^5), "t_RFRACN"]) = 
> (33*x_1^2+22*x_1+11)/(x_1+x_1^5); 
true
gap> 
gap> 
gap> # t_VEC
gap> 
gap> IF_Interface(IF_pari_gp, "primes", [10]);
[ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 ]
gap> IF_Interface(IF_pari_gp, "length", [[23,34,+E(4),4]]);
4
gap> IF_Interface(IF_pari_gp, "bernvec", [8]);
[ 1, 1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510 ]
gap> IF_Interface( IF_pari_gp, "", "[]" );
[  ]
gap> 
gap> 
gap> # t_COL
gap> 
gap> 
gap> # t_MAT
gap> 
gap> IF_Interface(IF_pari_gp,"factor",[312424]);
[ [ 2, 3 ], [ 7, 2 ], [ 797, 1 ] ]
gap> IF_Interface(IF_pari_gp,"factorback",[[ [ 2, 3 ], [ 7, 2 ], [ 797, 1 ] ]]);
312424
gap> IF_Interface(IF_pari_gp, "", [[[23,34],[E(4),4]]]);
[ [ 23, 34 ], [ E(4), 4 ] ]
gap> IF_Interface(IF_pari_gp, "matdet", [[[23,34],[E(4),4]]]);
92-34*E(4)
gap> 
gap> IF_LowLevelInterface( IF_pari_gp, "m", "", "[11,12,13;21,22,23]" );
gap> IF_LowLevelInterface( IF_pari_gp, "m2", "", "[m,m;m,m]" );
gap> IF_Interface(IF_pari_gp,"","m2");
[ [ [ [ 11, 12, 13 ], [ 21, 22, 23 ] ], [ [ 11, 12, 13 ], [ 21, 22, 23 ] ] ], 
  [ [ [ 11, 12, 13 ], [ 21, 22, 23 ] ], [ [ 11, 12, 13 ], [ 21, 22, 23 ] ] ] ]
gap> 
gap> IF_Interface( IF_pari_gp, "type", [EmptyMatrix(0)] );
"t_MAT"
gap> IF_Interface( IF_pari_gp, "", [EmptyMatrix(0)] );
[  ]
gap> IF_Interface( IF_pari_gp, "type", [[[11,22,33]]] );
"t_MAT"
gap> IF_Interface( IF_pari_gp, "", [[[11,22,33]]] );
[ [ 11, 22, 33 ] ]
gap> 
gap> 
gap> # t_STR
gap> 
gap> chars_ok :=Union([32..126],[128..254]);;
gap> # chars_ok :=Union([32..42],[44,59],[61..126]);; # with OpenMath
gap> for i in chars_ok do
>  s1:="";
>  Add(s1, CHAR_INT(i));
>  s2:=IF_Interface(IF_pari_gp, "Str", [s1] );
>  if not s2=s1 then Error(i);fi;
> od;
gap> 
gap> 
gap> # t_LIST
gap> 
gap> IF_Interface(IF_pari_gp, "", [[0,1/2,E(4),"ciao",[11,22,33]]]);
[ 0, 1/2, E(4), "ciao", [ 11, 22, 33 ] ]
gap> IF_Interface( IF_pari_gp, "", [[]] );
[  ]
gap> 
gap> 
gap> 
gap> # end of test file
gap> 
gap> STOP_TEST( "test", 10000 );
Test of the 'if' package
GAP4stones: 23
gap> 
