File Coverage

blib/lib/CXC/Number/Sequence/Role/BigNum.pm
Criterion Covered Total %
statement 18 18 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod n/a
total 25 25 100.0


line stmt bran cond sub pod time code
1             package CXC::Number::Sequence::Role::BigNum;
2              
3             # ABSTRACT: Role to return Math::BigFloats from Sequences
4              
5 3     3   270640 use v5.28;
  3         11  
6              
7 3     3   500 use Moo::Role;
  3         11990  
  3         20  
8              
9             our $VERSION = '0.13';
10              
11 3     3   1908 use experimental 'signatures';
  3         1235  
  3         22  
12 3     3   981 use namespace::clean;
  3         13479  
  3         28  
13              
14 5     5   49 sub _convert ( $self, $bignum ) {
  5         10  
  5         12  
  5         6  
15 5         34 require Ref::Util;
16              
17             return Ref::Util::is_plain_arrayref( $bignum )
18 5 100       1568 ? [ map { $_->copy } $bignum->@* ]
  28         2073  
19             : $bignum->copy;
20             }
21              
22             #
23             # This file is part of CXC-Number
24             #
25             # This software is Copyright (c) 2019 by Smithsonian Astrophysical Observatory.
26             #
27             # This is free software, licensed under:
28             #
29             # The GNU General Public License, Version 3, June 2007
30             #
31              
32             1;
33              
34             __END__
35              
36             =pod
37              
38             =for :stopwords Diab Jerius Smithsonian Astrophysical Observatory
39              
40             =head1 NAME
41              
42             CXC::Number::Sequence::Role::BigNum - Role to return Math::BigFloats from Sequences
43              
44             =head1 VERSION
45              
46             version 0.13
47              
48             =head1 SYNOPSIS
49              
50             my $obj = CXC::Number::Sequence->build( $class, %options)->elements => \@elements );
51             Moo::Role->apply_role_to_object( $obj, 'CXC::Number::Sequence::Role::BigNum' );
52              
53             =head1 DESCRIPTION
54              
55             A L<Moo> role providing a C<_convert> method which returns copies of the
56             passed L<Math::BigFloat> arrays and scalars.
57              
58             =head1 INTERNALS
59              
60             =head1 SUPPORT
61              
62             =head2 Bugs
63              
64             Please report any bugs or feature requests to bug-cxc-number@rt.cpan.org or through the web interface at: L<https://rt.cpan.org/Public/Dist/Display.html?Name=CXC-Number>
65              
66             =head2 Source
67              
68             Source is available at
69              
70             https://gitlab.com/djerius/cxc-number
71              
72             and may be cloned from
73              
74             https://gitlab.com/djerius/cxc-number.git
75              
76             =head1 SEE ALSO
77              
78             Please see those modules/websites for more information related to this module.
79              
80             =over 4
81              
82             =item *
83              
84             L<CXC::Number|CXC::Number>
85              
86             =item *
87              
88             L<CXC::Number::Sequence|CXC::Number::Sequence>
89              
90             =back
91              
92             =head1 AUTHOR
93              
94             Diab Jerius <djerius@cpan.org>
95              
96             =head1 COPYRIGHT AND LICENSE
97              
98             This software is Copyright (c) 2019 by Smithsonian Astrophysical Observatory.
99              
100             This is free software, licensed under:
101              
102             The GNU General Public License, Version 3, June 2007
103              
104             =cut