path: root/test/bigdecimal/test_bigdecimal.rb
AgeCommit message (Collapse)Author
2023-07-13Move bsearch test with Bigdecimal under the test_bigdecimal.rbHiroshi SHIBATA
When we extract bigdecimal as bundled gems, this test will be failed with `make test-all`.
2023-07-05[ruby/bigdecimal] Add .to_s('F') digit grouping for integer partcryptogopher
2023-02-17[ruby/bigdecimal] Handle correctly #remainder with infinity. FixesMaciej Rzasa
2023-01-27[ruby/bigdecimal] Add truffleruby in CIBenoit Daloze
2022-11-13[ruby/bigdecimal] Tweak check_rounding_mode_optionKenta Murata
2022-01-24[ruby/bigdecimal] Fix the maximum precision of the quotientKenta Murata
2022-01-24[ruby/bigdecimal] Fix typoKenta Murata
2021-12-24[ruby/bigdecimal] Fix the result precision of BigDecimal#divmodKenta Murata
2021-12-24[ruby/bigdecimal] Let BigDecimal#quo accept precisionKenta Murata
Fix GH-214.
2021-12-24[ruby/bigdecimal] Allow passing both float and precision in BigDecimal#divKenta Murata
Fix GH-212.
2021-12-24[ruby/bigdecimal] Add BigDecimal#precision_scaleKenta Murata
2021-12-24[ruby/bigdecimal] Add BigDecimal#scaleKenta Murata
Fixes GH-198.
2021-12-24[ruby/bigdecimal] Fix BigDecimal#precision for single DECDIG caseKenta Murata
Fix GH-205
2021-12-24[ruby/bigdecimal] Fix the precision of the adjusted quotientKenta Murata
2021-12-24[ruby/bigdecimal] Let BigDecimal_DoDivmod use the same precision calculation ↵Kenta Murata
as BigDecimal_divide
2021-12-24[ruby/bigdecimal] Use larger precision in divide for irrational or recurring ↵Kenta Murata
results Just in case for irrational or recurring results, the precision of the quotient is set to at least more than 2*Float::DIG plus alpha. [Bug #13754] [Fix GH-94]
2021-12-24[ruby/bigdecimal] Add tests for the issue GH-192Kenta Murata
2021-12-24[ruby/bigdecimal] Use values in RbConfig::LIMITS in testKenta Murata
2021-12-24[ruby/bigdecimal] Fix the style in test/bigdecimal/test_bigdecimal.rbKenta Murata
2021-12-24[ruby/bigdecimal] Fix negative Bignum conversionJean Boussier
Introduced in `rb_absint_size` return the number of bytes needed to fit the absolute integer, but negative integers need the sign, so one more bit, and potentially one more byte.
2021-12-24[ruby/bigdecimal] Fix test against #196Kenta Murata
2021-10-22Import bigdecimal-3.1.0.devHiroshi SHIBATA
2021-01-16[ruby/bigdecimal] Fix for the coerce cases in divide and DoDivmodKenta Murata
2021-01-13[ruby/bigdecimal] Allow digits=0 in BigDecimal(flt) and Float#to_dKenta Murata
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]
2021-01-13[ruby/bigdecimal] Use pre-allocated objects for special valuesKenta Murata
2021-01-13[ruby/bigdecimal] Fix exception message raised in Kernel.BigDecimalKenta Murata
2021-01-07[ruby/bigdecimal] Fix trailing zero handling in rb_uint64_convert_to_BigDecimalKenta Murata
2021-01-07[ruby/bigdecimal] Include TestBigDecimalBase in TestBigDecimalUtilKenta Murata
2021-01-02[ruby/bigdecimal] Fix test for Ruby 2.4Kenta Murata
Ruby 2.4 does not have RbConfig::LIMITS.
2021-01-02[ruby/bigdecimal] Implement special conversions for 64-bit integersKenta Murata
This change improves the conversion speed from small integers. ``` Comparison: big_n9 master: 4003688.9 i/s bigdecimal 3.0.0: 1270551.0 i/s - 3.15x slower big_n19 master: 5410096.4 i/s bigdecimal 3.0.0: 1000250.3 i/s - 5.41x slower ```
2021-01-02[ruby/bigdecimal] Fix test_limitKenta Murata
Keep the default value of BigDecimal.limit by BigDecimal.save_limit to avoid failures of the other test methods due to the unexpected limit.
2020-12-19[bigdecimal] Fix deprecation warning testKenta Murata
2020-12-19[bigdecimal] Add BigDecimal#n_significant_digitsKenta Murata
2020-12-19[bigdecimal] Make BigDecimal#precs deprecatedKenta Murata
2020-12-19[bigdecimal] Add BigDecimal#precisionKenta Murata
2020-12-19[bigdecimal] Fix test for d5ab8e8562Kenta Murata
2020-12-15Import bigdecimal 2.0.2 (#3905)Kenta Murata
* remove duplicated include * Make BigDecimal#round with argument < 1 return Integer Fixes [Bug #12780] * Use a higher default precision for BigDecimal#power and #** When a fractional power is given, increase the precision if the precision isn't specified via power's second argument: Float: increase by 15 (rough number of decimal precision in float) BigDecimal: increase by adding similar precision modifier as done to calculate the base precision. Rational: double the precision, since a BigDecimal is created, but the created BigDecimal uses the same precision. Increasing the precision for these power calculations has the obvious tradeoff of making the calculations slower. Fixes Ruby Bug #17264 * Use DBLE_FIG for a Float value * Version 2.0.1 Co-authored-by: pavel <> Co-authored-by: Jeremy Evans <> Notes: Merged-By: mrkn <>
2020-07-12bidecimal: improve tests' independence (#3297)Kenta Murata
Tests depending on the rounding mode must specify the appropriate rounding mode and restore to the original mode at the end. Notes: Merged-By: mrkn <>
2020-07-06[ruby/bigdecimal] Return US-ASCII string from BigDecimal#to_sKenta Murata
Fixes #159 Notes: Merged:
2020-07-06[ruby/bigdecimal] Make tests pass on Ruby 2.4Jeremy Evans Notes: Merged:
2020-07-06[ruby/bigdecimal] Remove definition of BigDecimal#initialize_copyJeremy Evans
This leaves the default definition, which will raise FrozenError. Notes: Merged:
2020-07-06[ruby/bigdecimal] Support a Complex in Kernel.BigDecimal()Kenta Murata Notes: Merged:
2020-07-06[ruby/bigdecimal] Undef BigDecimal#initialize_copyJeremy Evans
Both BigDecimal#clone and BigDecimal#dup return self, there is no reason to have initialize_copy exposed as a Ruby method. The same is true for initialize_clone and initialize_dup. Notes: Merged:
2020-07-05Removed duplicate test with test_BigDecimal_bug7522Nobuyoshi Nakada
2019-11-18More fixes for $SAFE/taint post mergingJeremy Evans
Notes: Merged:
2019-11-18Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans
This removes the related tests, and puts the related specs behind version guards. This affects all code in lib, including some libraries that may want to support older versions of Ruby. Notes: Merged:
2019-11-12[ruby/bigdecimal] Remove taint checkingJeremy Evans
This removes the taint checking. Taint support is deprecated in Ruby 2.7 and has no effect. I don't think removing the taint checks in earlier ruby versions will cause any problems.
2019-10-08Import changes from ruby/bigdecimal (#2531)Kenta Murata
Sync to ruby/bigdecimal@92356ba71c6bd325b0ab618c634a7aecf8cdc767 Notes: Merged-By: mrkn <>
2019-09-22test/bigdecimal/test_bigdecimal.rb: Use BigDecimal()Yusuke Endoh
instead of deprecated
2019-09-21Make Kernel#{Pathname,BigDecimal,Complex} return argument if given correct typeJeremy Evans
This is how Kernel#{Array,String,Float,Integer,Hash,Rational} work. BigDecimal and Complex instances are always frozen, so this should not cause backwards compatibility issues for those. Pathname instances are not frozen, so potentially this could cause backwards compatibility issues by not returning a new object. Based on a patch from Joshua Ballanco, some minor changes by me. Fixes [Bug #7522] Notes: Merged: