| 12345678901; // too large
==> 12345678901
typeof(_);
==> bigint
ring r=0,x,dp;
12345678901;
==> 12345678901
typeof(_);
==> bigint
// Note: 11*13*17*100*200*2000*503*1111*222222
// returns a machine integer:
11*13*17*100*200*2000*503*1111*222222;
==> // ** int overflow(*), result may be wrong
==> // ** int overflow(*), result may be wrong
==> // ** int overflow(*), result may be wrong
==> // ** int overflow(*), result may be wrong
==> -1875651584
// using the type cast number for a greater allowed range
number(11)*13*17*100*200*2000*503*1111*222222;
==> 12075748128684240000000
ring rp=32003,x,dp;
12345678901;
==> 12345678901
typeof(_);
==> bigint
intmat m[2][2] = 1,2,3,4;
m;
==> 1,2,
==> 3,4
m[2,2];
==> 4
typeof(_);
==> int
det(m);
==> -2
m[1,1] + m[2,1] == trace(m);
==> 0
! 0;
==> 1
1 and 2;
==> 1
intvec v = 1,2,3;
def d =transpose(v)*v; // scalarproduct gives an 1x1 intvec
typeof(d);
==> intvec
int i = d[1]; // access the first (the only) entry in the intvec
ring rr=31,(x,y,z),dp;
poly f = 1;
i = int(f); // cast to int
// Integers may be converted to constant polynomials by an assignment,
poly g=37;
// define the constant polynomial g equal to the image of
// the integer 37 in the actual coefficient field, here it equals 6
g;
==> 6
|