Annotation of 43BSDTahoe/ucb/pascal/tstpx/src/funcs.p, revision 1.1.1.1

1.1       root        1: program funcs(output);
                      2: 
                      3: type
                      4: sint=0..30000;
                      5: Sint=-30000..30000;
                      6: lint=0..100000;
                      7: Lint=-100000..100000;
                      8: color=(red,yellow,blue);
                      9: 
                     10: var
                     11: i :sint;
                     12: n :Sint;
                     13: j :lint;
                     14: m :Lint;
                     15: k :real;
                     16: l :color;
                     17: ptr :^integer;
                     18: 
                     19: begin
                     20: k:=0.7853981635;
                     21: { generate bound checks }
                     22: j:=98000;
                     23: j:=355;
                     24: i:=j;
                     25: i:=113;
                     26: m:=-25000;
                     27: m:=100;
                     28: n:=m;
                     29: n:=154;
                     30: assert(trunc(k) = 0, 'trunc(k)');
                     31: assert(round(k) = 1, 'round(k)');
                     32: assert(sqr(2.5) = 6.25, 'sqr(2.5)');
                     33: assert(sqr(j) = 126025, 'sqr(j)');
                     34: assert(sqr(i) = 12769, 'sqr(i)');
                     35: assert(succ(j) = 356, 'succ(j)');
                     36: assert(succ(i) = 114, 'succ(i)');
                     37: l:=yellow;
                     38: assert(succ(l) = blue, 'succ(l)');
                     39: assert(pred(l) = red, 'pred(l)');
                     40: assert(pred(j) = 354, 'pred(j)');
                     41: assert(pred(i) = 112, 'pred(i)');
                     42: assert(odd(i), 'odd(i)');
                     43: assert(odd(j), 'odd(j)');
                     44: assert(chr(j-355) = chr(0), 'chr(j-355)');
                     45: assert(sqrt(25) = 5.0, 'sqrt(25)');
                     46: assert(sqrt(m) = 10.0, 'sqrt(m)');
                     47: assert(sin(k)-cos(k) < 1e-7, 'sin(k)-cos(k)');
                     48: assert(ln(exp(k))-k < 1e-7, 'ln(exp(k)');
                     49: assert(arctan(1.0)-k < 1e-7, 'arctan(1.0)');
                     50: assert(expo(k) = -1, 'expo(k)');
                     51: assert(expo(-1e+10) = 10, 'expo(-1e+10)');
                     52: assert(expo(1e-10) = -10, 'expo(1e-10)');
                     53: new(ptr);
                     54: dispose(ptr);
                     55: assert(seed(seed(1)) = 1, 'seed(seed(1))');
                     56: assert(random(1.0) <= 1.0, 'random(1.0) <= 1.0');
                     57: assert(random(1.0) >= 0.0, 'random(1.0) >= 0.0');
                     58: end.

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.