File Coverage

blib/lib/smallnum/XS.pm
Criterion Covered Total %
statement 16 16 100.0
branch 4 4 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 smallnum::XS;
2              
3 4     4   543753 use 5.006;
  4         18  
4 4     4   29 use strict;
  4         29  
  4         128  
5 4     4   20 use warnings;
  4         16  
  4         468  
6              
7             our $VERSION = '0.10';
8 4     4   2711 use overload;
  4         8324  
  4         25  
9             require XSLoader;
10             XSLoader::load('smallnum::XS', $VERSION);
11              
12             sub import {
13 4 100   4   85 _set_precision($_[1]) if $_[1];
14 4 100       20 _set_offset($_[2]) if $_[2];
15 4         19 overload::constant integer => \&_smallnum;
16 4         108 overload::constant float => \&_smallnum;
17 4         68 overload::constant binary => \&_smallnum;
18             }
19              
20             1;
21              
22             __END__