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 | |
---|
1 | LIB "tst.lib"; tst_init(); |
---|
2 | 12345678901; // too large |
---|
3 | typeof(_); |
---|
4 | ring r=0,x,dp; |
---|
5 | 12345678901; |
---|
6 | typeof(_); |
---|
7 | // Note: 11*13*17*100*200*2000*503*1111*222222 |
---|
8 | // returns a machine integer: |
---|
9 | 11*13*17*100*200*2000*503*1111*222222; |
---|
10 | // using the type cast number for a greater allowed range |
---|
11 | number(11)*13*17*100*200*2000*503*1111*222222; |
---|
12 | ring rp=32003,x,dp; |
---|
13 | 12345678901; |
---|
14 | typeof(_); |
---|
15 | intmat m[2][2] = 1,2,3,4; |
---|
16 | m; |
---|
17 | m[2,2]; |
---|
18 | typeof(_); |
---|
19 | det(m); |
---|
20 | m[1,1] + m[2,1] == trace(m); |
---|
21 | ! 0; |
---|
22 | 1 and 2; |
---|
23 | intvec v = 1,2,3; |
---|
24 | def d =transpose(v)*v; // scalarproduct gives an 1x1 intvec |
---|
25 | typeof(d); |
---|
26 | int i = d[1]; // access the first (the only) entry in the intvec |
---|
27 | ring rr=31,(x,y,z),dp; |
---|
28 | poly f = 1; |
---|
29 | i = int(f); // cast to int |
---|
30 | // Integers may be converted to constant polynomials by an assignment, |
---|
31 | poly 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 |
---|
34 | g; |
---|
35 | tst_status(1);$ |
---|
Note: See
TracBrowser
for help on using the repository browser.