This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document string- and number-specific bitops in perlop
[perl5.git] / dist / Math-BigInt / t / big_pi_e.t
1 #!/usr/bin/perl -w
2
3 # Test bpi() and bexp()
4
5 use strict;
6 use Test::More tests => 8;
7
8 use Math::BigFloat;
9
10 #############################################################################
11
12 my $pi = Math::BigFloat::bpi();
13
14 ok (!exists $pi->{_a}, 'A not set');
15 ok (!exists $pi->{_p}, 'P not set');
16
17 $pi = Math::BigFloat->bpi();
18
19 ok (!exists $pi->{_a}, 'A not set');
20 ok (!exists $pi->{_p}, 'P not set');
21
22 $pi = Math::BigFloat->bpi(10);
23
24 is ($pi->{_a}, 10, 'A set');
25 is ($pi->{_p}, undef, 'P not set');
26
27 #############################################################################
28 my $e = Math::BigFloat->new(1)->bexp();
29
30 ok (!exists $e->{_a}, 'A not set');
31 ok (!exists $e->{_p}, 'P not set');
32
33