bigdecimal 3.2.1 → 3.2.2

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ext/bigdecimal/bigdecimal.c +13 -9
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac9ef6b7332d91d122fee9e0d0c4666cc503d356104ef2a3d93edcebaa6702fc
4
- data.tar.gz: dc80fd72843a3e4c56e81c9f0249c402234eb9b65e70551ed72417d5cf8a89b3
3
+ metadata.gz: 8737ecb678e63a8a9e0aefe2d0ea606a523915d08b66b69704967749e15e53bf
4
+ data.tar.gz: 0dec9bb1cf41f347efdc60b918bab5f14264e6fc082011870dbc62391fde1270
5
5
  SHA512:
6
- metadata.gz: 1a546b5482b99c164513ac4f17a3cd691f4b04e1d48b775b414e71c3681bdb076c0206c8cc1e5c72e4fd5b5d165583b2dd8082f4628664bbe977d2507c22627f
7
- data.tar.gz: ce32b1290903e0cfb2dd6fb00a20c4304c69672da72de7b1262bf2675f8a0dbab297f4c5a3fc1f5a0fe56e2a9146d6a12d515857e57f40f8f36fa5eaa911e360
6
+ metadata.gz: ddacbb0df3b6976bc560fab41363de45e4776c6e56d884a2c00a71015b838ff83d2a26b87e4af63d3e60fff27f6e90638f7cd6b363c62d06c78ac4c8250d6d5a
7
+ data.tar.gz: bc4ee4ace918f04364f882b69acb9c60bca9abc2405f426bbaa5831af21a9508c02c73c1f7302a3f25d387b7518d42095bc7bcbb817151e84ca2b9b0ce6889b5
@@ -31,7 +31,7 @@
31
31
  #include "bits.h"
32
32
  #include "static_assert.h"
33
33
 
34
- #define BIGDECIMAL_VERSION "3.2.1"
34
+ #define BIGDECIMAL_VERSION "3.2.2"
35
35
 
36
36
  /* #define ENABLE_NUMERIC_STRING */
37
37
 
@@ -513,15 +513,10 @@ BigDecimal_prec(VALUE self)
513
513
  }
514
514
 
515
515
  static void
516
- BigDecimal_count_precision_and_scale(VALUE self, ssize_t *out_precision, ssize_t *out_scale)
516
+ VpCountPrecisionAndScale(Real *p, ssize_t *out_precision, ssize_t *out_scale)
517
517
  {
518
- ENTER(1);
519
-
520
518
  if (out_precision == NULL && out_scale == NULL)
521
519
  return;
522
-
523
- Real *p;
524
- GUARD_OBJ(p, GetVpValue(self, 1));
525
520
  if (VpIsZero(p) || !VpIsDef(p)) {
526
521
  zero:
527
522
  if (out_precision) *out_precision = 0;
@@ -625,6 +620,15 @@ BigDecimal_count_precision_and_scale(VALUE self, ssize_t *out_precision, ssize_t
625
620
  }
626
621
  }
627
622
 
623
+ static void
624
+ BigDecimal_count_precision_and_scale(VALUE self, ssize_t *out_precision, ssize_t *out_scale)
625
+ {
626
+ ENTER(1);
627
+ Real *p;
628
+ GUARD_OBJ(p, GetVpValue(self, 1));
629
+ VpCountPrecisionAndScale(p, out_precision, out_scale);
630
+ }
631
+
628
632
  /*
629
633
  * call-seq:
630
634
  * precision -> integer
@@ -2166,8 +2170,8 @@ BigDecimal_div2(VALUE self, VALUE b, VALUE n)
2166
2170
 
2167
2171
  if (ix == 0) {
2168
2172
  ssize_t a_prec, b_prec;
2169
- BigDecimal_count_precision_and_scale(av->obj, &a_prec, NULL);
2170
- BigDecimal_count_precision_and_scale(bv->obj, &b_prec, NULL);
2173
+ VpCountPrecisionAndScale(av, &a_prec, NULL);
2174
+ VpCountPrecisionAndScale(bv, &b_prec, NULL);
2171
2175
  ix = ((a_prec > b_prec) ? a_prec : b_prec) + BIGDECIMAL_DOUBLE_FIGURES;
2172
2176
  if (2 * BIGDECIMAL_DOUBLE_FIGURES > ix)
2173
2177
  ix = 2 * BIGDECIMAL_DOUBLE_FIGURES;
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: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenta Murata