blib/lib/POSIX/1003/Math.pm

filter: Statementstmt 51.3% 19 / 37 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 19.0% 4 / 21 Podpod 100% 17 / 17 totaltotal 51.9% 40 / 77 CC 2 SCAR 7.8
CC
2
Cov
49%
rint
6.0
acos
2.0
asin
2.0
CRAP 2.2
« blib/lib/POSIX/1003/Signals.pm ↑ Summary blib/lib/POSIX/1003/Proc.pm »
1 # Copyrights 2011-2013 by [Mark Overmeer].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.01.
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 package POSIX::1003::Math;
9 3 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 $VERSION = '0.98';
11  
12 3 ▶use base 'POSIX::1003::Module';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 # Block respectively from float.h, math.h, stdlib.h, limits.h
15 1 my @constants = qw/
16 DBL_DIG DBL_EPSILON DBL_MANT_DIG DBL_MAX DBL_MAX_10_EXP
17 DBL_MAX_EXP DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP FLT_DIG FLT_EPSILON
18 FLT_MANT_DIG FLT_MAX FLT_MAX_10_EXP FLT_MAX_EXP FLT_MIN FLT_MIN_10_EXP
19 FLT_MIN_EXP FLT_RADIX FLT_ROUNDS LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG
20 LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN LDBL_MIN_10_EXP
21 LDBL_MIN_EXP
22  
23 HUGE_VAL
24  
25 RAND_MAX
26  
27 CHAR_BIT CHAR_MAX CHAR_MIN UCHAR_MAX SCHAR_MAX SCHAR_MIN
28 SHRT_MAX SHRT_MIN USHRT_MAX
29 INT_MAX INT_MIN UINT_MAX
30 LONG_MAX LONG_MIN ULONG_MAX
31 /;
32  
33 # Only from math.h. The first block are defined in POSIX.xs, the
34 # second block present in Core. The last is from string.h
35 1 our @IN_CORE = qw/abs exp log sqrt sin cos atan2 rand srand int/;
36  
37 1 my @functions = qw/
38 acos asin atan ceil cosh floor fmod frexp
39 ldexp log10 modf sinh tan tanh
40  
41 div rint pow
42 strtod strtol strtoul
43 /;
44 1 push @functions, @IN_CORE;
45  
46 1 our %EXPORT_TAGS =
47 ( constants => \@constants
48 , functions => \@functions
49 );
50  
51  
52 # the argument to be optional is important for expression priority!
53 0 ▶sub acos(_) { goto &POSIX::acos }
Subroutine acos: not called CC=1 SCAR=6.9
Pod documented
54 0 ▶sub asin(_) { goto &POSIX::asin }
Subroutine asin: not called CC=1 SCAR=6.9
Pod documented
55 0 ▶sub atan(_) { goto &POSIX::atan }
Subroutine atan: not called CC=1 SCAR=6.9
Pod documented
56 0 ▶sub ceil(_) { goto &POSIX::ceil }
Subroutine ceil: not called CC=1 SCAR=6.9
Pod documented
57 0 ▶sub cosh(_) { goto &POSIX::cosh }
Subroutine cosh: not called CC=1 SCAR=6.9
Pod documented
58 0 ▶sub floor(_) { goto &POSIX::floor }
Subroutine floor: not called CC=1 SCAR=6.9
Pod documented
59 0 ▶sub frexp(_) { goto &POSIX::frexp }
Subroutine frexp: not called CC=1 SCAR=6.9
Pod documented
60 0 ▶sub ldexp(_) { goto &POSIX::ldexp }
Subroutine ldexp: not called CC=1 SCAR=6.9
Pod documented
61 0 ▶sub log10(_) { goto &POSIX::log10 }
Subroutine log10: not called CC=1 SCAR=6.9
Pod documented
62 0 ▶sub sinh(_) { goto &POSIX::sinh }
Subroutine sinh: not called CC=1 SCAR=6.9
Pod documented
63 0 ▶sub tan(_) { goto &POSIX::tan }
Subroutine tan: not called CC=1 SCAR=6.9
Pod documented
64 0 ▶sub tanh(_) { goto &POSIX::tanh }
Subroutine tanh: not called CC=1 SCAR=6.9
Pod documented
65  
66 0 ▶sub modf($$) { goto &POSIX::modf }
Subroutine modf: not called CC=1 SCAR=6.9
Pod documented
67 0 ▶sub fmod($$) { goto &POSIX::fmod }
Subroutine fmod: not called CC=1 SCAR=6.9
Pod documented
68  
69 # All provided by POSIX.xs
70  
71  
72 0 ▶sub div($$) { ( int($_[0]/$_[1]), ($_[0] % $_[1]) ) }
Subroutine div: not called CC=1 SCAR=6.9
Pod documented
73  
74  
75 0 ▶sub rint(;$) { my $v = @_ ? shift : $_; int($v + 0.5) }
Subroutine rint: not called CC=2 SCAR=17.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
76  
77  
78 0 ▶sub pow($$) { $_[0] ** $_[1] }
Subroutine pow: not called CC=1 SCAR=6.9
Pod documented
79  
80  
81 #------------------------------
82  
83  
84 1 1;
« blib/lib/POSIX/1003/Signals.pm ↑ Summary blib/lib/POSIX/1003/Proc.pm »