ruby_native_statistics 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/changelog.md +4 -0
- data/ext/ruby_native_statistics/conversions.c +13 -2
- data/lib/ruby_native_statistics/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af6f814231417189ed6603a5d1720773ece2f00c4933b09e82e5bd048cffab1c
|
4
|
+
data.tar.gz: 8084a6f089db196e31912467dd5e2d66d4ff8f67f0d8aa0997fd49435328cd4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4db606d6948a7d0c36cd3735d1dd08071acd00ee682e5ce85d49dcc8b01359fafe95e50a7d4ac5a3c5137531f118de6173a607e96ede09956092d05c8bcb5518
|
7
|
+
data.tar.gz: 127c3d4c7d540f298890c49e1cb3a88679a5a47a1747877a8467ddce6f1bc98d1c723c6f6eed8fc944498bbb5b9bb380238755daf244b94cce1bd101d47a9098
|
data/Gemfile.lock
CHANGED
data/changelog.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "conversions.h"
|
2
|
+
#include "float.h"
|
2
3
|
|
3
4
|
int compare_doubles(const void *a, const void *b)
|
4
5
|
{
|
@@ -8,7 +9,17 @@ int compare_doubles(const void *a, const void *b)
|
|
8
9
|
double cmp_a = *dbl_a;
|
9
10
|
double cmp_b = *dbl_b;
|
10
11
|
|
11
|
-
|
12
|
+
if (fabs(cmp_a - cmp_b) <= (DBL_EPSILON * fabs(cmp_a + cmp_b)))
|
13
|
+
{
|
14
|
+
return 0;
|
15
|
+
}
|
16
|
+
|
17
|
+
if (cmp_a > cmp_b)
|
18
|
+
{
|
19
|
+
return 1;
|
20
|
+
}
|
21
|
+
|
22
|
+
return -1;
|
12
23
|
}
|
13
24
|
|
14
25
|
double *sorted_ruby_array(VALUE array, long array_length)
|
@@ -20,7 +31,7 @@ double *sorted_ruby_array(VALUE array, long array_length)
|
|
20
31
|
|
21
32
|
if (working_array == NULL)
|
22
33
|
{
|
23
|
-
rb_raise(rb_eStandardError, "unknown problem
|
34
|
+
rb_raise(rb_eStandardError, "unknown problem sorting array (possibly array is too large)");
|
24
35
|
}
|
25
36
|
|
26
37
|
for (i = 0; i < array_length; i++)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_native_statistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cory Buecker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
|
-
rubygems_version: 3.5.
|
134
|
+
rubygems_version: 3.5.6
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: High performance, native (C) implementations of various statistical functions.
|