line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- mode: perl; -*- |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Math::BigFloat::Constant; |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
119587
|
use strict; |
|
2
|
|
|
|
|
22
|
|
|
2
|
|
|
|
|
52
|
|
6
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
70
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '1.13'; |
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
8418
|
use Math::BigFloat '1.999802'; |
|
2
|
|
|
|
|
99316
|
|
|
2
|
|
|
|
|
12
|
|
11
|
|
|
|
|
|
|
our @ISA = qw( Math::BigFloat ); |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
41080
|
use overload; # inherit from Math::BigFloat |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
14
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
############################################################################## |
16
|
|
|
|
|
|
|
# We Are a True Math::BigFloat, But Thou Shallst Not Modify Us |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub modify { |
19
|
36
|
|
|
36
|
1
|
62953
|
my ($self, $method) = @_; |
20
|
|
|
|
|
|
|
|
21
|
36
|
50
|
|
|
|
85
|
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
|
36
|
|
|
|
|
112
|
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
|
6
|
|
|
6
|
1
|
18728
|
my $x = shift; |
39
|
|
|
|
|
|
|
|
40
|
6
|
50
|
|
|
|
15
|
return Math::BigFloat->new($x) unless ref($x); |
41
|
6
|
|
|
|
|
17
|
Math::BigFloat->copy($x); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub as_int { |
45
|
1
|
|
|
1
|
1
|
1691
|
my $x = shift; |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
4
|
die("Can not modify ", ref($x), " $x via as_int()\n"); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |