lib/Acme/MITHALDU/XSGrabBag.pm

filter: Statementstmt 100% 13 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 100% 20 / 20 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Acme/MITHALDU/XSGrabBag/Inline.pm ↑ Summary
1 package Acme::MITHALDU::XSGrabBag;
2 4 ▶use strictures;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Acme::MITHALDU::XSGrabBag::Inline ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 our $VERSION = '1.161260'; # VERSION
7  
8 # ABSTRACT: a bunch of XS math functions i'm not sure where to shove yet
9  
10 #
11 # This file is part of Acme-MITHALDU-XSGrabBag
12 #
13 #
14 # Christian Walde has dedicated the work to the Commons by waiving all of his
15 # or her rights to the work worldwide under copyright law and all related or
16 # neighboring legal rights he or she had in the work, to the extent allowable by
17 # law.
18 #
19 # Works under CC0 do not require attribution. When citing the work, you should
20 # not imply endorsement by the author.
21 #
22  
23 our @EXPORT_OK = qw(
24 mix
25 deg2rad
26 rad2deg
27 dot2_product
28 );
29  
30 Acme::MITHALDU::XSGrabBag::Inline->import(
31 C => join "\n",
32 _mix(),
33 _deg2rad(),
34 _rad2deg(),
35 _dot2_product(),
36 );
37  
38  
39 sub _mix {
40 2 ▶ <<'...';
Subroutine _mix: called CC=1 SCAR=0.0
41 int mix(int a, int b, int c) {
42 a -= b; a -= c; a ^= (c>>13);
43 b -= c; b -= a; b ^= (a<<8);
44 c -= a; c -= b; c ^= (b>>13);
45 a -= b; a -= c; a ^= (c>>12);
46 b -= c; b -= a; b ^= (a<<16);
47 c -= a; c -= b; c ^= (b>>5);
48 a -= b; a -= c; a ^= (c>>3);
49 b -= c; b -= a; b ^= (a<<10);
50 c -= a; c -= b; c ^= (b>>15);
51 return c;
52 }
53 ...
54 }
55  
56  
57 sub _deg2rad {
58 2 ▶ <<'...';
Subroutine _deg2rad: called CC=1 SCAR=0.0
59 float deg2rad(float degrees) {
60 return 0.0174532925 * degrees;
61 }
62 ...
63 }
64  
65  
66 sub _rad2deg {
67 2 ▶ <<'...';
Subroutine _rad2deg: called CC=1 SCAR=0.0
68 float rad2deg(float radians) {
69 return 57.2957795786 * radians;
70 }
71 ...
72 }
73  
74  
75 sub _dot2_product {
76 2 ▶ <<'...';
Subroutine _dot2_product: called CC=1 SCAR=0.0
77 int dot2_product( int xa, int ya, int xb, int yb ) {
78 int sum = 0;
79 sum += xa * xb;
80 sum += ya * yb;
81 return sum;
82 }
83 ...
84 }
85  
86 1;
87  
88 __END__
« blib/lib/Acme/MITHALDU/XSGrabBag/Inline.pm ↑ Summary