Граф коммитов

22 Коммитов

Автор SHA1 Сообщение Дата
Kenta Murata b2a74948b6
[ruby/bigdecimal] Add tests for the issue GH-192
https://github.com/ruby/bigdecimal/commit/e864828b47
2021-12-24 02:28:54 +09:00
Kenta Murata a5b4b806de
[ruby/bigdecimal] Allow digits=0 in BigDecimal(flt) and Float#to_d
Using dtoa of mode=0, we can determine the number of digits in decimal that is
necessary to represent the given Float number without errors.

This change permits digits=0 in BigDecimal(flt) and Float#to_d, and these
methods use dtoa of mode=0 when the given digits is 0.

Internal implicit conversion from Float also uses digits=0.

[Fix GH-70]

https://github.com/ruby/bigdecimal/commit/2dbe170e35
2021-01-13 11:49:18 +09:00
Kenta Murata 89f3125207 [ruby/bigdecimal] Add test cases of conversion from Float
https://github.com/ruby/bigdecimal/commit/28d3836366
2021-01-09 20:35:08 +09:00
Kenta Murata 698d7947c3 [ruby/bigdecimal] Include TestBigDecimalBase in TestBigDecimalUtil
https://github.com/ruby/bigdecimal/commit/f732201df1
2021-01-07 10:19:46 +09:00
Kenta Murata e1424c3501
[bigdecimal] Fix the default precision of Float#to_d
Fix https://github.com/ruby/bigdecimal/issues/70
[Bug #13331]

https://github.com/ruby/bigdecimal/commit/aa536cd4b5
2020-12-19 22:13:53 +09:00
Kenta Murata 9b433d34da
bidecimal: improve tests' independence (#3297)
Tests depending on the rounding mode must specify the appropriate rounding
mode and restore to the original mode at the end.
2020-07-12 17:30:29 +09:00
Kenta Murata 03a33603c6
[ruby/bigdecimal] Add Complex#to_d
https://github.com/ruby/bigdecimal/commit/97e794ac97
2020-07-06 01:15:46 +09:00
Kenta Murata dd0c75fdc2
Import changes from ruby/bigdecimal (#2531)
Sync to ruby/bigdecimal@92356ba71c
2019-10-08 09:06:28 +09:00
mrkn ccdba542d3 Import bigdecimal-1.4.0.pre.20181220a
* https://github.com/ruby/bigdecimal/compare/v1.4.0.pre.20181214a..v1.4.0.pre.20181220a

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-20 23:29:49 +00:00
mrkn 2810c12a99 Import bigdecimal 1.4.0.pre.20181205a
* https://github.com/ruby/bigdecimal/compare/74d25ef..v1.4.0.pre.20181205a

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05 11:30:24 +00:00
mrkn f15cf0918a Revert bigdecimal 1.4.0 related commits
* Revert "Remove unnecessary linker flags"

  This reverts commit 49efa01579.

* Revert "Move dependency on gemspec"

  This reverts commit bfb64d4765.

* Revert "Remove unnecessary directory listing"

  This reverts commit 86661b5c60.

* Revert "* expand tabs."

  This reverts commit 35ada33f83.

* Revert "Import bigdecimal-1.4.0.pre-20181204a"

  This reverts commit 8891bb3bd6.

* Revert "ext/bigdecimal/bigdecimal.c: drop unused function"

  This reverts commit 5ceeea4da1.

* Revert "* expand tabs."

  This reverts commit e021386e90.

* Revert "Import bigdecimal-1.4.0.pre-20181130a"

  This reverts commit a0e438cd3c.

* Revert "NEWS: write about bigdecimal updates"

  This reverts commit 89455ff2ba.

* Revert "Fix rubyspec of bigdecimal for ruby <2.6"

  This reverts commit 4bcdeeb65e.

* Revert "Fix rubyspec against bigdecimal updates"

  This reverts commit c8fb30fc9e.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-05 04:01:53 +00:00
mrkn a0e438cd3c Import bigdecimal-1.4.0.pre-20181130a
* https://github.com/ruby/bigdecimal/compare/74d25ef..v1.4.0.pre.20181130a

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-02 05:21:54 +00:00
mrkn 61e58f7dc4 bigdecimal: version 1.3.3
Import bigdecimal version 1.3.3.  The full commit log is here:

  https://github.com/ruby/bigdecimal/compare/v1.3.2...v1.3.3

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-13 15:28:30 +00:00
mrkn 65285fbdb8 bigdecimal: version 1.3.2
Import bigdecimal version 1.3.2.  The full commit log is here:

  https://github.com/ruby/bigdecimal/compare/v1.3.1...v1.3.2

This fixes [ruby-core:79603] [Bug #13232]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-13 06:03:18 +00:00
mrkn 70f772c3ef bigdecimal: version 1.3.1
Import bigdecimal version 1.3.1.  The full commit log is here:

  https://github.com/ruby/bigdecimal/compare/v1.3.0...v1.3.1

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-10 13:23:58 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
mrkn 2308fb170e * ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec):
treat 0.0 and -0.0 of floating-point numbers specially for an optimization
  and to correctly propagate its signbit to the result.
  [Bug #9214] [ruby-core:58858]

* test/bigdecimal/test_bigdecimal.rb: add tests case for the above change.

* test/bigdecimal/test_bigdecimal_util.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-05 16:34:59 +00:00
mrkn 1699396fe5 * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): fix the number
of figures.  Patch by Vipul A M <vipulnsward@gmail.com>.
  https://github.com/ruby/ruby/pull/323  fix GH-323

* test/bigdecimal/test_bigdecimal_util.rb: fix for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04 06:37:44 +00:00
mrkn dca0b41777 * ext/bigdecimal/lib/bigdecimal/util.rb (Rational#to_d):
zero or negative precision is error.  fixes #5098.
  [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
  change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:49:47 +00:00
mrkn 079fb8d4c3 * ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): modified for
specifying precision.  fixes #5098.  [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
  change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:48:25 +00:00
mrkn 2fcb91c74c * ext/bigdecimal/lib/bigdecimal/util.rb (Integer#to_d): added
for symmetry to BigDecimal() function with an Integer.
  fixes #5098.  [ruby-dev:44210]
* test/bigdecimal/test_bigdecimal_util.rb: add test for the above
  change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:46:42 +00:00
mrkn 5ba05758fe * ext/bigdecimal/lib/bigdecimal/util.rb (BigDecimal#to_d): added
for adapting other Numeric subclasses.  [ruby-dev:44245]
* test/bigdecimal/test_bigdecimal_util.rb: test for the above change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-26 15:40:27 +00:00