689f367b3fc15c2448a8c17f3a5d7481e94dc86f
[p5sagit/p5-mst-13.2.git] / t / op / exp.t
1 #!./perl
2
3 BEGIN {
4     chdir 't' if -d 't';
5     @INC = '../lib';
6     require './test.pl';
7 }
8
9 plan tests => 6;
10
11 # compile time evaluation
12
13 $s = sqrt(2);
14 is(substr($s,0,5), '1.414');
15
16 $s = exp(1);
17 is(substr($s,0,7), '2.71828');
18
19 ok(exp(log(1)) == 1);
20
21 # run time evaluation
22
23 $x1 = 1;
24 $x2 = 2;
25 $s = sqrt($x2);
26 is(substr($s,0,5), '1.414');
27
28 $s = exp($x1);
29 is(substr($s,0,7), '2.71828');
30
31 ok(exp(log($x1)) == 1);