source: git/Tst/Manual/int_expressions.tst @ 0d6b7fc

spielwiese Release-4-3-2p2
Last change on this file since 0d6b7fc was 894057, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
ADD: Tests from online manual (res+stat on mamawutz): short ones Tst/Manual/s.lst
  • Property mode set to 100644
File size: 940 bytes
Line 
1LIB "tst.lib"; tst_init();
212345678901; // too large
3typeof(_);
4ring r=0,x,dp;
512345678901;
6typeof(_);
7// Note: 11*13*17*100*200*2000*503*1111*222222
8// returns a machine integer:
911*13*17*100*200*2000*503*1111*222222;
10// using the type cast number for a greater allowed range
11number(11)*13*17*100*200*2000*503*1111*222222;
12ring rp=32003,x,dp;
1312345678901;
14typeof(_);
15intmat m[2][2] = 1,2,3,4;
16m;
17m[2,2];
18typeof(_);
19det(m);
20m[1,1] + m[2,1] == trace(m);
21! 0;
221 and 2;
23intvec v = 1,2,3;
24def d =transpose(v)*v;    // scalarproduct gives an 1x1 intvec
25typeof(d);
26int i = d[1];             // access the first (the only) entry in the intvec
27ring rr=31,(x,y,z),dp;
28poly f = 1;
29i = int(f);               // cast to int
30// Integers may be converted to constant  polynomials by an assignment,
31poly g=37;
32// define the constant polynomial g equal to the image of
33// the integer 37 in the actual coefficient field, here it equals 6
34g;
35tst_status(1);$
Note: See TracBrowser for help on using the repository browser.