summaryrefslogtreecommitdiff
path: root/test/bigdecimal
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/bigdecimal] Handle correctly #remainder with infinity. FixesMaciej Rzasa2023-02-171-0/+11
| | | | | | https://github.com/ruby/bigdecimal/pull/187 https://github.com/ruby/bigdecimal/commit/4b8572d452
* [ruby/bigdecimal] Add truffleruby in CIBenoit Daloze2023-01-271-1/+5
| | | | https://github.com/ruby/bigdecimal/commit/5a25e26e08
* [ruby/bigdecimal] Tweak check_rounding_mode_optionKenta Murata2022-11-131-2/+12
| | | | https://github.com/ruby/bigdecimal/commit/e1c6c9be25
* [ruby/bigdecimal] Fix the maximum precision of the quotientKenta Murata2022-01-241-0/+7
| | | | | | Fixes https://github.com/ruby/bigdecimal/pull/220 https://github.com/ruby/bigdecimal/commit/127a1b5a31
* [ruby/bigdecimal] Fix typoKenta Murata2022-01-241-1/+1
| | | | https://github.com/ruby/bigdecimal/commit/79c09b4dac
* [ruby/bigdecimal] Fix the result precision of BigDecimal#divmodKenta Murata2021-12-241-2/+4
| | | | https://github.com/ruby/bigdecimal/commit/a32f6cb9e2
* [ruby/bigdecimal] Let BigDecimal#quo accept precisionKenta Murata2021-12-241-0/+24
| | | | | | Fix GH-214. https://github.com/ruby/bigdecimal/commit/13e0e93f37
* [ruby/bigdecimal] Allow passing both float and precision in BigDecimal#divKenta Murata2021-12-241-0/+10
| | | | | | Fix GH-212. https://github.com/ruby/bigdecimal/commit/900bb7fcf5
* [ruby/bigdecimal] Add BigDecimal#precision_scaleKenta Murata2021-12-241-0/+11
| | | | https://github.com/ruby/bigdecimal/commit/c019caeaba
* [ruby/bigdecimal] Add BigDecimal#scaleKenta Murata2021-12-241-0/+53
| | | | | | Fixes GH-198. https://github.com/ruby/bigdecimal/commit/4fbec55680
* [ruby/bigdecimal] Fix BigDecimal#precision for single DECDIG caseKenta Murata2021-12-241-8/+8
| | | | | | Fix GH-205 https://github.com/ruby/bigdecimal/commit/7d198394a2
* [ruby/bigdecimal] Fix the precision of the adjusted quotientKenta Murata2021-12-241-0/+4
| | | | https://github.com/ruby/bigdecimal/commit/8dc8cd339d
* [ruby/bigdecimal] Let BigDecimal_DoDivmod use the same precision calculation ↵Kenta Murata2021-12-241-0/+7
| | | | | | as BigDecimal_divide https://github.com/ruby/bigdecimal/commit/11cb2c8840
* [ruby/bigdecimal] Use larger precision in divide for irrational or recurring ↵Kenta Murata2021-12-241-2/+15
| | | | | | | | | | | 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] https://github.com/ruby/bigdecimal/commit/99442c75d3
* [ruby/bigdecimal] Add tests for the issue GH-192Kenta Murata2021-12-243-1/+39
| | | | https://github.com/ruby/bigdecimal/commit/e864828b47
* [ruby/bigdecimal] Use values in RbConfig::LIMITS in testKenta Murata2021-12-241-3/+7
| | | | https://github.com/ruby/bigdecimal/commit/14e35f5a70
* [ruby/bigdecimal] Fix the style in test/bigdecimal/test_bigdecimal.rbKenta Murata2021-12-241-3/+3
| | | | https://github.com/ruby/bigdecimal/commit/aa31ef2f33
* [ruby/bigdecimal] Fix negative Bignum conversionJean Boussier2021-12-241-0/+10
| | | | | | | | | | Introduced in https://github.com/ruby/bigdecimal/commit/4792a917d806 `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. https://github.com/ruby/bigdecimal/commit/0f3d5d0eb7
* [ruby/bigdecimal] Fix test against #196Kenta Murata2021-12-241-2/+2
| | | | https://github.com/ruby/bigdecimal/commit/a834eb92a2
* Import bigdecimal-3.1.0.devHiroshi SHIBATA2021-10-222-5/+3
|
* [ruby/bigdecimal] Fix for the coerce cases in divide and DoDivmodKenta Murata2021-01-161-0/+13
| | | | https://github.com/ruby/bigdecimal/commit/1cb92487f7
* [ruby/bigdecimal] Allow digits=0 in BigDecimal(flt) and Float#to_dKenta Murata2021-01-132-3/+7
| | | | | | | | | | | | | | 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
* [ruby/bigdecimal] Use pre-allocated objects for special valuesKenta Murata2021-01-131-1/+7
| | | | https://github.com/ruby/bigdecimal/commit/95c201f2d3
* [ruby/bigdecimal] Fix exception message raised in Kernel.BigDecimalKenta Murata2021-01-131-1/+13
| | | | | https://github.com/ruby/bigdecimal/commit/d163f170a4 https://github.com/ruby/bigdecimal/commit/ff8eeeb064
* [ruby/bigdecimal] Add test cases of conversion from FloatKenta Murata2021-01-091-0/+6
| | | | https://github.com/ruby/bigdecimal/commit/28d3836366
* [ruby/bigdecimal] Fix trailing zero handling in rb_uint64_convert_to_BigDecimalKenta Murata2021-01-071-0/+4
| | | | https://github.com/ruby/bigdecimal/commit/2056604d56
* [ruby/bigdecimal] Include TestBigDecimalBase in TestBigDecimalUtilKenta Murata2021-01-075-5/+6
| | | | https://github.com/ruby/bigdecimal/commit/f732201df1
* [ruby/bigdecimal] Fix test for Ruby 2.4Kenta Murata2021-01-021-10/+20
| | | | | | Ruby 2.4 does not have RbConfig::LIMITS. https://github.com/ruby/bigdecimal/commit/c8087523b0
* [ruby/bigdecimal] Implement special conversions for 64-bit integersKenta Murata2021-01-021-0/+17
| | | | | | | | | | | | | | | | | 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 ``` https://github.com/ruby/bigdecimal/commit/3429bd7e6f
* [ruby/bigdecimal] Fix test_limitKenta Murata2021-01-021-9/+10
| | | | | | | Keep the default value of BigDecimal.limit by BigDecimal.save_limit to avoid failures of the other test methods due to the unexpected limit. https://github.com/ruby/bigdecimal/commit/bdc1cc6585
* [bigdecimal] Fix deprecation warning testKenta Murata2020-12-191-0/+4
|
* [bigdecimal] Add BigDecimal#n_significant_digitsKenta Murata2020-12-191-0/+51
| | | | | https://github.com/ruby/bigdecimal/commit/981dc48f95 https://github.com/ruby/bigdecimal/commit/9ecf880ec04
* [bigdecimal] Make BigDecimal#precs deprecatedKenta Murata2020-12-191-6/+16
| | | | | https://github.com/ruby/bigdecimal/commit/7e80e6e145 https://github.com/ruby/bigdecimal/commit/0ed7846e8c
* [bigdecimal] Add BigDecimal#precisionKenta Murata2020-12-191-0/+49
| | | | https://github.com/ruby/bigdecimal/commit/458eb66c49
* [bigdecimal] Make bigdecimal Ractor safeKenta Murata2020-12-191-0/+23
| | | | | https://github.com/ruby/bigdecimal/commit/93fc392640 https://github.com/ruby/bigdecimal/commit/a90d13c4d0
* [bigdecimal] Fix the default precision of Float#to_dKenta Murata2020-12-191-4/+12
| | | | | | | Fix https://github.com/ruby/bigdecimal/issues/70 [Bug #13331] https://github.com/ruby/bigdecimal/commit/aa536cd4b5
* [bigdecimal] Fix test for d5ab8e8562Kenta Murata2020-12-191-1/+1
|
* Import bigdecimal 2.0.2 (#3905)Kenta Murata2020-12-151-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 <pavel.rosicky@easy.cz> Co-authored-by: Jeremy Evans <code@jeremyevans.net>
* bidecimal: improve tests' independence (#3297)Kenta Murata2020-07-122-7/+15
| | | | Tests depending on the rounding mode must specify the appropriate rounding mode and restore to the original mode at the end.
* [ruby/bigdecimal] Return US-ASCII string from BigDecimal#to_sKenta Murata2020-07-061-12/+17
| | | | | | Fixes #159 https://github.com/ruby/bigdecimal/commit/57ee92e700
* [ruby/bigdecimal] Add Complex#to_dKenta Murata2020-07-061-0/+12
| | | | https://github.com/ruby/bigdecimal/commit/97e794ac97
* [ruby/bigdecimal] Make tests pass on Ruby 2.4Jeremy Evans2020-07-061-3/+4
| | | | https://github.com/ruby/bigdecimal/commit/9d19e842ee
* [ruby/bigdecimal] Remove definition of BigDecimal#initialize_copyJeremy Evans2020-07-061-4/+6
| | | | | | This leaves the default definition, which will raise FrozenError. https://github.com/ruby/bigdecimal/commit/05e843d838
* [ruby/bigdecimal] Support a Complex in Kernel.BigDecimal()Kenta Murata2020-07-061-0/+8
| | | | https://github.com/ruby/bigdecimal/commit/00795cb01f
* [ruby/bigdecimal] Undef BigDecimal#initialize_copyJeremy Evans2020-07-061-0/+6
| | | | | | | | | 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. https://github.com/ruby/bigdecimal/commit/aaf237fa9e
* Removed duplicate test with test_BigDecimal_bug7522Nobuyoshi Nakada2020-07-051-5/+0
|
* More fixes for $SAFE/taint post mergingJeremy Evans2019-11-181-7/+9
|
* Deprecate taint/trust and related methods, and make the methods no-opsJeremy Evans2019-11-181-0/+9
| | | | | | 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.
* [ruby/bigdecimal] Remove taint checkingJeremy Evans2019-11-121-9/+0
| | | | | | | | 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. https://github.com/ruby/bigdecimal/commit/1918d466f3
* Import changes from ruby/bigdecimal (#2531)Kenta Murata2019-10-082-21/+43
| | | Sync to ruby/bigdecimal@92356ba71c6bd325b0ab618c634a7aecf8cdc767