bigdecimal 3.2.0 → 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 +14 -9
  3. metadata +3 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4fdad45c0e9519d352fa25d4134af80ce6897c8196bcb3bf0e25d6ebcea8918
4
- data.tar.gz: ed56f36c2e5fd8cea29b0de49ac2c25edf186de643d69aff660677ada7a79ae8
3
+ metadata.gz: 8737ecb678e63a8a9e0aefe2d0ea606a523915d08b66b69704967749e15e53bf
4
+ data.tar.gz: 0dec9bb1cf41f347efdc60b918bab5f14264e6fc082011870dbc62391fde1270
5
5
  SHA512:
6
- metadata.gz: 2481253ce262ad322882ca3c3ae5c14eec4b4cc599c34c4aac0e71f3161cece17adce5b506fc94548018ab9605c411e1746d40bdc9f086ef3dfd085197ce7d15
7
- data.tar.gz: cb3ee7815dd3d4f63271ffb09c09ff485dd9603b6fc5cb639416cf1f7c20df576aac5e53c891245bbc0a03789b4f2dcd514cf7e48c186f05f58600a799a5ed6e
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.0"
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
@@ -2151,6 +2155,7 @@ BigDecimal_div2(VALUE self, VALUE b, VALUE n)
2151
2155
  ix = check_int_precision(n);
2152
2156
 
2153
2157
  pl = VpSetPrecLimit(0);
2158
+ if (ix == 0) ix = pl;
2154
2159
 
2155
2160
  GUARD_OBJ(av, GetVpValue(self, 1));
2156
2161
  if (RB_FLOAT_TYPE_P(b) && ix > BIGDECIMAL_DOUBLE_FIGURES) {
@@ -2165,8 +2170,8 @@ BigDecimal_div2(VALUE self, VALUE b, VALUE n)
2165
2170
 
2166
2171
  if (ix == 0) {
2167
2172
  ssize_t a_prec, b_prec;
2168
- BigDecimal_count_precision_and_scale(av->obj, &a_prec, NULL);
2169
- BigDecimal_count_precision_and_scale(bv->obj, &b_prec, NULL);
2173
+ VpCountPrecisionAndScale(av, &a_prec, NULL);
2174
+ VpCountPrecisionAndScale(bv, &b_prec, NULL);
2170
2175
  ix = ((a_prec > b_prec) ? a_prec : b_prec) + BIGDECIMAL_DOUBLE_FIGURES;
2171
2176
  if (2 * BIGDECIMAL_DOUBLE_FIGURES > ix)
2172
2177
  ix = 2 * BIGDECIMAL_DOUBLE_FIGURES;
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigdecimal
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenta Murata
8
8
  - Zachary Scott
9
9
  - Shigeo Kobayashi
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2025-05-29 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies: []
15
14
  description: This library provides arbitrary-precision decimal floating-point number
16
15
  class.
@@ -47,7 +46,6 @@ licenses:
47
46
  - BSD-2-Clause
48
47
  metadata:
49
48
  changelog_uri: https://github.com/ruby/bigdecimal/blob/master/CHANGES.md
50
- post_install_message:
51
49
  rdoc_options: []
52
50
  require_paths:
53
51
  - lib
@@ -62,8 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
62
60
  - !ruby/object:Gem::Version
63
61
  version: '0'
64
62
  requirements: []
65
- rubygems_version: 3.5.10
66
- signing_key:
63
+ rubygems_version: 3.6.7
67
64
  specification_version: 4
68
65
  summary: Arbitrary-precision decimal floating-point number library.
69
66
  test_files: []