line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package BRIANG::Dist::Minimal; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
68695
|
use 5.10.1; |
|
1
|
|
|
|
|
14
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
21
|
|
6
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
125
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
BRIANG::Dist::Minimal - A minimal implementation. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 VERSION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
This is |
15
|
|
|
|
|
|
|
version 0.0101 |
16
|
|
|
|
|
|
|
released 2020-11-21 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.0101'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SYNOPSIS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
use BRIANG::Dist::Minimal; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $BDM = BRIANG::Dist::Minimal->new(7); |
27
|
|
|
|
|
|
|
say $BDM->value(); # 3.5 |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 DESCRIPTION |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
This module is a component from the C |
32
|
|
|
|
|
|
|
distribution. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
This module uses an object-oriented approach to half numbers. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 new |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
$object = BRIANG::Dist::Minimal->new($value) |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Initialises a new C object, and returns |
43
|
|
|
|
|
|
|
it. C<$value> sets the number to be halved. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub new { |
48
|
1
|
|
|
1
|
1
|
97
|
my ($class, $initial) = @_; |
49
|
1
|
|
|
|
|
6
|
return bless {value => $initial / 2}, $class; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 METHODS |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 value |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
$halved_value = $BDM->value(); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
C returns the halved value. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=cut |
61
|
|
|
|
|
|
|
|
62
|
1
|
|
|
1
|
1
|
1392
|
sub value { shift->{value} } |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 AUTHOR, COPYRIGHT AND LICENSE |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Copyright 2020 Brian Greenfield |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This is free software. You can use, redistribute, and/or modify it |
69
|
|
|
|
|
|
|
under the terms laid out in the L. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 CODE REPOSITORY AND ISSUE REPORTING |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This project's source code is |
74
|
|
|
|
|
|
|
L on |
75
|
|
|
|
|
|
|
L. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Issues should be reported using the project's GitHub L
|
78
|
|
|
|
|
|
|
tracker|https://github.com/briang/p5-briang-dist-perfect/issues>. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Contributions are welcome. Please use L
|
81
|
|
|
|
|
|
|
Requests|https://github.com/briang/p5-briang-dist-perfect/pulls>. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; |