diff options
author | Tels <nospam-abuse@bloodgate.com> | 2007-06-26 22:56:45 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2007-06-27 12:57:52 +0000 |
commit | fade31f0d958af49245e9d5d2d39ab5492d90d94 (patch) | |
tree | 95738216b73e942e33eb7e0dd719212b6bdb78c2 /lib/bignum | |
parent | 30afc38d44f16307c535215ac91b9b6259f70b14 (diff) | |
download | perl-fade31f0d958af49245e9d5d2d39ab5492d90d94.tar.gz |
Re: RFC: bigint et. al exporting PI method? [PATCH]
Message-Id: <200706262056.47311@bloodgate.com>
p4raw-id: //depot/perl@31479
Diffstat (limited to 'lib/bignum')
-rw-r--r-- | lib/bignum/t/big_e_pi.t | 23 | ||||
-rw-r--r-- | lib/bignum/t/bii_e_pi.t | 23 | ||||
-rw-r--r-- | lib/bignum/t/bir_e_pi.t | 23 |
3 files changed, 69 insertions, 0 deletions
diff --git a/lib/bignum/t/big_e_pi.t b/lib/bignum/t/big_e_pi.t new file mode 100644 index 0000000000..b0de593c54 --- /dev/null +++ b/lib/bignum/t/big_e_pi.t @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w + +############################################################################### +# test for e() and PI() exports + +use Test::More; +use strict; + +BEGIN + { + $| = 1; + chdir 't' if -d 't'; + unshift @INC, '../lib'; + plan tests => 4; + } + +use bignum qw/e PI/; + +is (e, "2.718281828459045235360287471352662497757", 'e'); +is (PI, "3.141592653589793238462643383279502884197", 'PI'); + +is (e(10), "2.718281828", 'e'); +is (PI(10), "3.141592654", 'PI'); diff --git a/lib/bignum/t/bii_e_pi.t b/lib/bignum/t/bii_e_pi.t new file mode 100644 index 0000000000..169464011e --- /dev/null +++ b/lib/bignum/t/bii_e_pi.t @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w + +############################################################################### +# test for e() and PI() exports + +use Test::More; +use strict; + +BEGIN + { + $| = 1; + chdir 't' if -d 't'; + unshift @INC, '../lib'; + plan tests => 4; + } + +use bigint qw/e PI/; + +is (e, "2", 'e'); +is (PI, "3", 'PI'); + +is (e(10), "2", 'e'); +is (PI(10), "3", 'PI'); diff --git a/lib/bignum/t/bir_e_pi.t b/lib/bignum/t/bir_e_pi.t new file mode 100644 index 0000000000..0041e2cbd8 --- /dev/null +++ b/lib/bignum/t/bir_e_pi.t @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w + +############################################################################### +# test for e() and PI() exports + +use Test::More; +use strict; + +BEGIN + { + $| = 1; + chdir 't' if -d 't'; + unshift @INC, '../lib'; + plan tests => 4; + } + +use bigrat qw/e PI/; + +is (e, "2.718281828459045235360287471352662497757", 'e'); +is (PI, "3.141592653589793238462643383279502884197", 'PI'); + +is (e(10), "2.718281828", 'e'); +is (PI(10), "3.141592654", 'PI'); |