bigdecimal 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/bigdecimal.gemspec +2 -2
- data/ext/bigdecimal/bigdecimal.c +2 -2
- data/ext/bigdecimal/bigdecimal.h +3 -1
- data/ext/bigdecimal/extconf.rb +0 -2
- data/lib/bigdecimal/util.rb +17 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 73213efa446db0aae9dc184b48255acbd670ac6dc1fff31c8e6361bba7288103
|
4
|
+
data.tar.gz: e092ee3be9410d2b888690e5c88b1c7f4e66307f2b01592512ef33f9cfb6ab00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d314519b706ac6ddb2e8c71723138109ba09d1f399c150b0b1095ff5081b1fd5b96aef5ff4e896ba802b6a6dcb6f220dd41f058cb5796d469b3096b885d7459f
|
7
|
+
data.tar.gz: daadfc6a6d520ac15847cd57c75407b87a4884055f6ad24f42ad96194aa530d0461303a6c305790aaeea8ea98f93cca4be81e7143bcc27617061711ae22a914a
|
data/bigdecimal.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
|
-
bigdecimal_version = '1.3.
|
3
|
+
bigdecimal_version = '1.3.5'
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "bigdecimal"
|
@@ -34,6 +34,6 @@ Gem::Specification.new do |s|
|
|
34
34
|
s.add_development_dependency "rake", "~> 10.0"
|
35
35
|
s.add_development_dependency "rake-compiler", ">= 0.9"
|
36
36
|
s.add_development_dependency "rake-compiler-dock", ">= 0.6.1"
|
37
|
-
s.add_development_dependency "minitest", "
|
37
|
+
s.add_development_dependency "minitest", "< 5.0.0"
|
38
38
|
s.add_development_dependency "pry"
|
39
39
|
end
|
data/ext/bigdecimal/bigdecimal.c
CHANGED
@@ -110,7 +110,7 @@ rb_rational_num(VALUE rat)
|
|
110
110
|
#ifdef HAVE_TYPE_STRUCT_RRATIONAL
|
111
111
|
return RRATIONAL(rat)->num;
|
112
112
|
#else
|
113
|
-
return rb_funcall(rat, rb_intern("numerator"));
|
113
|
+
return rb_funcall(rat, rb_intern("numerator"), 0);
|
114
114
|
#endif
|
115
115
|
}
|
116
116
|
#endif
|
@@ -122,7 +122,7 @@ rb_rational_den(VALUE rat)
|
|
122
122
|
#ifdef HAVE_TYPE_STRUCT_RRATIONAL
|
123
123
|
return RRATIONAL(rat)->den;
|
124
124
|
#else
|
125
|
-
return rb_funcall(rat, rb_intern("denominator"));
|
125
|
+
return rb_funcall(rat, rb_intern("denominator"), 0);
|
126
126
|
#endif
|
127
127
|
}
|
128
128
|
#endif
|
data/ext/bigdecimal/bigdecimal.h
CHANGED
@@ -227,7 +227,9 @@ extern VALUE rb_cBigDecimal;
|
|
227
227
|
#define VP_SIGN_POSITIVE_INFINITE 3 /* Positive infinite number */
|
228
228
|
#define VP_SIGN_NEGATIVE_INFINITE -3 /* Negative infinite number */
|
229
229
|
|
230
|
-
#
|
230
|
+
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
|
231
|
+
#define FLEXIBLE_ARRAY_SIZE /* */
|
232
|
+
#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
231
233
|
#define FLEXIBLE_ARRAY_SIZE 0
|
232
234
|
#else
|
233
235
|
#define FLEXIBLE_ARRAY_SIZE 1
|
data/ext/bigdecimal/extconf.rb
CHANGED
data/lib/bigdecimal/util.rb
CHANGED
@@ -132,3 +132,20 @@ class Rational < Numeric
|
|
132
132
|
BigDecimal(self, precision)
|
133
133
|
end
|
134
134
|
end
|
135
|
+
|
136
|
+
|
137
|
+
class NilClass
|
138
|
+
# call-seq:
|
139
|
+
# nil.to_d -> bigdecimal
|
140
|
+
#
|
141
|
+
# Returns nil represented as a BigDecimal.
|
142
|
+
#
|
143
|
+
# require 'bigdecimal'
|
144
|
+
# require 'bigdecimal/util'
|
145
|
+
#
|
146
|
+
# nil.to_d # => 0.0
|
147
|
+
#
|
148
|
+
def to_d
|
149
|
+
BigDecimal(0)
|
150
|
+
end
|
151
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bigdecimal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenta Murata
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-06-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|
@@ -58,16 +58,16 @@ dependencies:
|
|
58
58
|
name: minitest
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - "
|
61
|
+
- - "<"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
63
|
+
version: 5.0.0
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- - "
|
68
|
+
- - "<"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
70
|
+
version: 5.0.0
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: pry
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
126
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.6
|
127
|
+
rubygems_version: 2.7.6
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: Arbitrary-precision decimal floating-point number library.
|