perl 3.0 patch #22 patch #19, continued
[p5sagit/p5-mst-13.2.git] / t / op.exp
1 #!./perl
2
3 # $Header: op.exp,v 3.0 89/10/18 15:29:01 lwall Locked $
4
5 print "1..6\n";
6
7 # compile time evaluation
8
9 $s = sqrt(2);
10 if (substr($s,0,5) eq '1.414') {print "ok 1\n";} else {print "not ok 1\n";}
11
12 $s = exp(1);
13 if (substr($s,0,7) eq '2.71828') {print "ok 2\n";} else {print "not ok 2\n";}
14
15 if (exp(log(1)) == 1) {print "ok 3\n";} else {print "not ok 3\n";}
16
17 # run time evaluation
18
19 $x1 = 1;
20 $x2 = 2;
21 $s = sqrt($x2);
22 if (substr($s,0,5) eq '1.414') {print "ok 4\n";} else {print "not ok 4\n";}
23
24 $s = exp($x1);
25 if (substr($s,0,7) eq '2.71828') {print "ok 5\n";} else {print "not ok 5\n";}
26
27 if (exp(log($x1)) == 1) {print "ok 6\n";} else {print "not ok 6\n";}