stat_c 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0e5819680b725e08009314b625cd71e806fd2bc
4
- data.tar.gz: 707e936d379f538b9ac30661c3d7b8aa99a8d0ab
3
+ metadata.gz: bd7506aea370251a6f91d5e6b6dd7dec6f8e6662
4
+ data.tar.gz: 17bc1d29da62b1a7308c054d832a089cc0ae4d2a
5
5
  SHA512:
6
- metadata.gz: 4a2338631efc5343c4181147bf65aa90e0306fb679772c676bbeeada9de57998f24467a012fe2d39cfde2ec1bc6e58ba2b419aa8adf853fd932dbbe7521bbd77
7
- data.tar.gz: 70702b3acb197b3b35d6de33d733c00ac86ee11891f6994bb64f8751c0ffa0545f652b6e1e58f50a794848020d3c7358038a4afe7d9d48693cdf59226b3e28b0
6
+ metadata.gz: 07d8a9391e1c0c24bc8f52fd85019996e3fde773fb6e4c487d0656ce4b7d2039d117b1b424941c2fb405a21866c7fefc2c09465d2cb371235af43c1aa5c7528c
7
+ data.tar.gz: 6b374a44fa989f01c1c6369c6358b3255418325500a11ea80855226e147a796e338e05bf6d3399ec2a7cbc57fb75c44f3132c062a237f00be72451efc08b96ca
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # StatC
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/stat_c.svg)](https://badge.fury.io/rb/stat_c) [![Build Status](https://travis-ci.org/mooreryan/stat_c.svg?branch=master)](https://travis-ci.org/mooreryan/stat_c) [![Coverage Status](https://coveralls.io/repos/github/mooreryan/stat_c/badge.svg?branch=master)](https://coveralls.io/github/mooreryan/stat_c?branch=master)
4
+
3
5
  Fast, well documented C stats extension for Ruby.
4
6
 
5
7
  ## Installation
data/ext/stat_c/stat_c.c CHANGED
@@ -67,7 +67,8 @@ static VALUE sc_mean(VALUE obj, VALUE ary)
67
67
 
68
68
  unsigned long i = 0;
69
69
  long double sum = 0;
70
- size_t len = assert_array_not_empty(ary);
70
+ size_t len = 0;
71
+ len = assert_array_not_empty(ary);
71
72
 
72
73
  for (i = 0; i < len; ++i) {
73
74
  sum += NUM2DBL(rb_ary_entry(ary, i));
@@ -105,7 +106,8 @@ static VALUE sc_var(int argc, VALUE* argv, VALUE obj)
105
106
 
106
107
  unsigned long i = 0;
107
108
  long double sum = 0;
108
- size_t len = assert_array_not_empty(ary);
109
+ size_t len = 0;
110
+ len = assert_array_not_empty(ary);
109
111
 
110
112
  long double mean = NUM2DBL(sc_mean(obj, ary));
111
113
 
@@ -177,7 +179,8 @@ static VALUE sc_se(int argc, VALUE* argv, VALUE obj)
177
179
 
178
180
  long double sd = NUM2DBL(sc_sd(argc, argv, obj));
179
181
 
180
- size_t len = assert_array_not_empty(ary);
182
+ size_t len = 0;
183
+ len = assert_array_not_empty(ary);
181
184
 
182
185
  return DBL2NUM(sd / sqrt(len));
183
186
  }
@@ -1,4 +1,4 @@
1
1
  module StatC
2
2
  # module version number
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stat_c
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Moore