bigdecimal 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bigdecimal.c +19 -5
- data/bigdecimal.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d7c070b55ea42a8186edff5bd590ec595c3f91b
|
4
|
+
data.tar.gz: 2b387b97b4360f632e8f71d17ad69b0e3ce0d582
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1bd4f4b4301d592507985496a19121906d4aeb9db7e3b862595e71ef1c87d6f3ac1d69227b8a1a582ec091cd6afb51f7f54e48db53bba2447623de62cd21500
|
7
|
+
data.tar.gz: 602f15737c778167bd453b408c6fe18c411461943f73ed819de569deb8c271676a97d356aecb8d95986660cc4b917933a694ddeec1ad7c3c78ec411006adadd7
|
data/bigdecimal.c
CHANGED
@@ -99,6 +99,20 @@ static ID id_eq;
|
|
99
99
|
# define RRATIONAL_NEGATIVE_P(x) RTEST(rb_funcall((x), '<', 1, INT2FIX(0)))
|
100
100
|
#endif
|
101
101
|
|
102
|
+
#ifndef DECIMAL_SIZE_OF_BITS
|
103
|
+
#define DECIMAL_SIZE_OF_BITS(n) (((n) * 3010 + 9998) / 9999)
|
104
|
+
/* an approximation of ceil(n * log10(2)), upto 65536 at least */
|
105
|
+
#endif
|
106
|
+
|
107
|
+
#ifdef PRIsVALUE
|
108
|
+
# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
|
109
|
+
# define RB_OBJ_STRING(obj) (obj)
|
110
|
+
#else
|
111
|
+
# define PRIsVALUE "s"
|
112
|
+
# define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj)
|
113
|
+
# define RB_OBJ_STRING(obj) StringValueCStr(obj)
|
114
|
+
#endif
|
115
|
+
|
102
116
|
/*
|
103
117
|
* ================== Ruby Interface part ==========================
|
104
118
|
*/
|
@@ -274,8 +288,8 @@ SomeOneMayDoIt:
|
|
274
288
|
unable_to_coerce_without_prec:
|
275
289
|
if (must) {
|
276
290
|
rb_raise(rb_eArgError,
|
277
|
-
"%
|
278
|
-
|
291
|
+
"%"PRIsVALUE" can't be coerced into BigDecimal without a precision",
|
292
|
+
RB_OBJ_CLASSNAME(v));
|
279
293
|
}
|
280
294
|
return NULL;
|
281
295
|
}
|
@@ -2261,8 +2275,8 @@ BigDecimal_power(int argc, VALUE*argv, VALUE self)
|
|
2261
2275
|
/* fall through */
|
2262
2276
|
default:
|
2263
2277
|
rb_raise(rb_eTypeError,
|
2264
|
-
"wrong argument type %
|
2265
|
-
|
2278
|
+
"wrong argument type %"PRIsVALUE" (expected scalar Numeric)",
|
2279
|
+
RB_OBJ_CLASSNAME(vexp));
|
2266
2280
|
}
|
2267
2281
|
|
2268
2282
|
if (VpIsZero(x)) {
|
@@ -2521,7 +2535,7 @@ BigDecimal_new(int argc, VALUE *argv)
|
|
2521
2535
|
if (NIL_P(nFig)) {
|
2522
2536
|
rb_raise(rb_eArgError,
|
2523
2537
|
"can't omit precision for a %"PRIsVALUE".",
|
2524
|
-
|
2538
|
+
RB_OBJ_CLASSNAME(iniValue));
|
2525
2539
|
}
|
2526
2540
|
return GetVpValueWithPrec(iniValue, mf, 1);
|
2527
2541
|
|
data/bigdecimal.gemspec
CHANGED
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.2.
|
4
|
+
version: 1.2.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: 2014-01-
|
13
|
+
date: 2014-01-15 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: This library provides arbitrary-precision decimal floating-point number
|
16
16
|
class.
|