Move Math::BigInt from ext/ to cpan/
[p5sagit/p5-mst-13.2.git] / cpan / Math-BigInt / t / big_pi_e.t
CommitLineData
36ec1dfe 1#!/usr/bin/perl -w
2
3# Test bpi() and bexp()
4
5use Test::More;
6use strict;
7
8BEGIN
9 {
10 $| = 1;
11 # to locate the testing files
12 my $location = $0; $location =~ s/big_pi_e.t//i;
13 if ($ENV{PERL_CORE})
14 {
15 # testing with the core distribution
16 @INC = qw(../lib);
17 }
18 unshift @INC, '../lib';
19 if (-d 't')
20 {
21 chdir 't';
22 require File::Spec;
23 unshift @INC, File::Spec->catdir(File::Spec->updir, $location);
24 }
25 else
26 {
27 unshift @INC, $location;
28 }
29 print "# INC = @INC\n";
30
31 plan tests => 8;
32 }
33
34use Math::BigFloat;
35
36#############################################################################
37
38my $pi = Math::BigFloat::bpi();
39
40ok (!exists $pi->{_a}, 'A not set');
41ok (!exists $pi->{_p}, 'P not set');
42
43$pi = Math::BigFloat->bpi();
44
45ok (!exists $pi->{_a}, 'A not set');
46ok (!exists $pi->{_p}, 'P not set');
47
48$pi = Math::BigFloat->bpi(10);
49
50is ($pi->{_a}, 10, 'A set');
51is ($pi->{_p}, undef, 'P not set');
52
53#############################################################################
54my $e = Math::BigFloat->new(1)->bexp();
55
56ok (!exists $e->{_a}, 'A not set');
57ok (!exists $e->{_p}, 'P not set');
58
59