line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- mode: perl; -*- |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Math::BigInt::Constant; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
64922
|
use strict; |
|
2
|
|
|
|
|
21
|
|
|
2
|
|
|
|
|
58
|
|
6
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
78
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.14'; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
1149
|
use Math::BigInt '1.999802'; |
|
2
|
|
|
|
|
30303
|
|
|
2
|
|
|
|
|
11
|
|
11
|
|
|
|
|
|
|
our @ISA = qw( Math::BigInt ); |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
23855
|
use overload; # inherit from Math::BigInt |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
16
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
############################################################################## |
16
|
|
|
|
|
|
|
# We Are a True Math::BigInt, But Thou Shallst Not Modify Us |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub modify { |
19
|
33
|
|
|
33
|
1
|
58237
|
my ($self, $method) = @_; |
20
|
|
|
|
|
|
|
|
21
|
33
|
50
|
|
|
|
99
|
unless (defined $method) { |
22
|
0
|
|
|
|
|
0
|
my @callinfo = caller(0); |
23
|
0
|
|
|
|
|
0
|
for (my $i = 1 ; ; ++$i) { |
24
|
0
|
|
|
|
|
0
|
my @next = caller($i); |
25
|
0
|
0
|
|
|
|
0
|
last unless @next; |
26
|
0
|
|
|
|
|
0
|
@callinfo = @next; |
27
|
|
|
|
|
|
|
} |
28
|
0
|
|
|
|
|
0
|
$method = $callinfo[3]; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
33
|
|
|
|
|
153
|
die("Can not modify ", ref($self), " $self via $method()\n"); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
############################################################################## |
35
|
|
|
|
|
|
|
# But cloning us creates a modifyable Math::BigInt, so that overload works |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub copy { |
38
|
7
|
|
|
7
|
1
|
27629
|
my $x = shift; |
39
|
|
|
|
|
|
|
|
40
|
7
|
50
|
|
|
|
30
|
return Math::BigInt->new($x) unless ref($x); |
41
|
7
|
|
|
|
|
37
|
Math::BigInt->copy($x); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |