summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/bigdecimal.c
AgeCommit message (Collapse)Author
2021-01-10[ruby/bigdecimal] Avoid casting negative value to size_tKenta Murata
https://github.com/ruby/bigdecimal/f047b2786f
2021-01-10[ruby/bigdecimal] Use smallest local variable scope in GetVpValueWithPrecKenta Murata
https://github.com/ruby/bigdecimal/commit/44f26b9aa0
2021-01-09[ruby/bigdecimal] Stop using GetVpValueWithPrec in ↵Kenta Murata
rb_rational_convert_to_BigDecimal https://github.com/ruby/bigdecimal/commit/b4f470da61 https://github.com/ruby/bigdecimal/commit/44a78df866
2021-01-09[ruby/bigdecimal] Add assertions for checking the argument typesKenta Murata
https://github.com/ruby/bigdecimal/commit/96c9ebd886
2021-01-09[ruby/bigdecimal] Stop using GetVpValueWithPrec in ↵Kenta Murata
rb_float_convert_to_BigDecimal https://github.com/ruby/bigdecimal/commit/33e7c50263 https://github.com/ruby/bigdecimal/commit/d3c1b0b921
2021-01-07[ruby/bigdecimal] Fix trailing zero handling in rb_uint64_convert_to_BigDecimalKenta Murata
https://github.com/ruby/bigdecimal/commit/2056604d56
2021-01-06[ruby/bigdecimal] Rename BDIGIT to DECDIGKenta Murata
https://github.com/ruby/bigdecimal/commit/686487d942
2021-01-06Need to convert the return value of rb_big_cmpKenta Murata
2021-01-06[ruby/bigdecimal] Optimize the conversion from small BignumKenta Murata
https://github.com/ruby/bigdecimal/commit/4792a917d8
2021-01-04[ruby/bigdecimal] Move some definitions to missing.hKenta Murata
https://github.com/ruby/bigdecimal/commit/c2b22cc8b3 https://github.com/ruby/bigdecimal/commit/8cbca8481d https://github.com/ruby/bigdecimal/commit/f05aecf673
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 ``` https://github.com/ruby/bigdecimal/commit/3429bd7e6f
2020-12-31[ruby/bigdecimal] Refactor object allocationKenta Murata
https://github.com/ruby/bigdecimal/commit/271cebe567
2020-12-31[ruby/bigdecimal] Remove ToValueKenta Murata
https://github.com/ruby/bigdecimal/commit/97e9feeebd
2020-12-30[ruby/bigdecimal] Remove VP_EXCEPTION_MEMORYKenta Murata
It is no longer used due to the previous commit. https://github.com/ruby/bigdecimal/commit/7d463f802b
2020-12-30[ruby/bigdecimal] Remove needless pointer checksKenta Murata
xmalloc and xrealloc return non-NULL pointers or raise memory error. https://github.com/ruby/bigdecimal/commit/507f0a6a64
2020-12-29[ruby/bigdecimal] Alloc wrapper object before VpAllocKenta Murata
Calling TypedData_Wrap_Struct after VpAlloc may cause memory leak. This commit reverts d11b78f9c420f39ee800b9feed4839cd28f4ff5c. https://github.com/ruby/bigdecimal/commit/2c5a288caf
2020-12-29[ruby/bigdecimal] Refactor to extract VpCheckExceptionKenta Murata
https://github.com/ruby/bigdecimal/commit/6fd171308b
2020-12-29[ruby/bigdecimal] Refactor to decompose VpNewVarArg into small functionsKenta Murata
https://github.com/ruby/bigdecimal/commit/7504871c48
2020-12-29[ruby/bigdecimal] Reduce needless object allocation in f_BigDecimalKenta Murata
https://github.com/ruby/bigdecimal/commit/5c808eeabb
2020-12-28[ruby/bigdecimal] [Doc] Fix the document of BigDecimal()Kenta Murata
[ci-skip] https://github.com/ruby/bigdecimal/commit/905d0345ec
2020-12-28[ruby/bigdecimal] Reduce conditional branch count in VpNewVarArgKenta Murata
https://github.com/ruby/bigdecimal/commit/741fb3e00f
2020-12-20bigdecimal: initialize conditionally assigned variableNobuyoshi Nakada
2020-12-19[bigdecimal] Add BigDecimal#n_significant_digitsKenta Murata
https://github.com/ruby/bigdecimal/commit/981dc48f95 https://github.com/ruby/bigdecimal/commit/9ecf880ec04
2020-12-19[bigdecimal] Make BigDecimal#precs deprecatedKenta Murata
https://github.com/ruby/bigdecimal/commit/7e80e6e145 https://github.com/ruby/bigdecimal/commit/0ed7846e8c
2020-12-19[bigdecimal] Add BigDecimal#precisionKenta Murata
https://github.com/ruby/bigdecimal/commit/458eb66c49
2020-12-19[bigdecimal] Make bigdecimal Ractor safeKenta Murata
https://github.com/ruby/bigdecimal/commit/93fc392640 https://github.com/ruby/bigdecimal/commit/a90d13c4d0
2020-12-19[bigdecimal] Use DBLE_FIGKenta Murata
https://github.com/ruby/bigdecimal/commit/12296dcb90
2020-12-19[bigdecimal] Fix the default precision of Float#to_dKenta Murata
Fix https://github.com/ruby/bigdecimal/issues/70 [Bug #13331] https://github.com/ruby/bigdecimal/commit/aa536cd4b5
2020-12-19[bigdecimal] Use rb_undef_alloc_func to undefine allocateKenta 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 <pavel.rosicky@easy.cz> Co-authored-by: Jeremy Evans <code@jeremyevans.net> Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
2020-10-10Fixed typo in commentIkko Ashimine
alway -> always Notes: Merged: https://github.com/ruby/ruby/pull/3646
2020-07-06[ruby/bigdecimal] Return US-ASCII string from BigDecimal#to_sKenta Murata
Fixes #159 https://github.com/ruby/bigdecimal/commit/57ee92e700 Notes: Merged: https://github.com/ruby/ruby/pull/3295
2020-07-06[ruby/bigdecimal] Support Ruby < 2.6Kenta Murata
https://github.com/ruby/bigdecimal/commit/61ec452599 Notes: Merged: https://github.com/ruby/ruby/pull/3295
2020-07-06[ruby/bigdecimal] Remove definition of BigDecimal#initialize_copyJeremy Evans
This leaves the default definition, which will raise FrozenError. https://github.com/ruby/bigdecimal/commit/05e843d838 Notes: Merged: https://github.com/ruby/ruby/pull/3295
2020-07-06[ruby/bigdecimal] Support a Complex in Kernel.BigDecimal()Kenta Murata
https://github.com/ruby/bigdecimal/commit/00795cb01f Notes: Merged: https://github.com/ruby/ruby/pull/3295
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. https://github.com/ruby/bigdecimal/commit/aaf237fa9e Notes: Merged: https://github.com/ruby/ruby/pull/3295
2020-05-13ext/bigdecimal/bigdecimal.c, ext/date/date_core.c: undef NDEBUGYusuke Endoh
`#define NDEBUG` produces "macro redefined" warnings when it is already defined via cppflags
2020-04-08Suppress -Wshorten-64-to-32 warningsNobuyoshi Nakada
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. https://github.com/ruby/bigdecimal/commit/1918d466f3
2019-10-08Import changes from ruby/bigdecimal (#2531)Kenta Murata
Sync to ruby/bigdecimal@92356ba71c6bd325b0ab618c634a7aecf8cdc767 Notes: Merged-By: mrkn <mrkn@ruby-lang.org>
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: https://github.com/ruby/ruby/pull/2473
2019-07-11Default to true when no exception flag [Bug #15987]Nobuyoshi Nakada
2019-07-11Fixed argument in the fallback function [Bug #15987]Nobuyoshi Nakada
2019-07-11Removed wrong argument in the fallback function [Bug #15987]Nobuyoshi Nakada
2019-07-11Check exception flag as a bool [Bug #15987]Nobuyoshi Nakada
2018-12-23Import bigdecimal-1.4.0mrkn
* https://github.com/ruby/bigdecimal/compare/v1.4.0.pre.20181220a..v1.4.0 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-20Import bigdecimal-1.4.0.pre.20181220amrkn
* 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-05Import bigdecimal 1.4.0.pre.20181205amrkn
* 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-05Revert bigdecimal 1.4.0 related commitsmrkn
* Revert "Remove unnecessary linker flags" This reverts commit 49efa01579272d52d28bd361c498d96ca92e986e. * Revert "Move dependency on gemspec" This reverts commit bfb64d476578eadd61a738149726da37840f068d. * Revert "Remove unnecessary directory listing" This reverts commit 86661b5c60b8da6e5641c9c772b57857a1f988f4. * Revert "* expand tabs." This reverts commit 35ada33f8386b56611f10b1a0a4e5667e9b08071. * Revert "Import bigdecimal-1.4.0.pre-20181204a" This reverts commit 8891bb3bd602bdbabd24260cf1e431475dc027c8. * Revert "ext/bigdecimal/bigdecimal.c: drop unused function" This reverts commit 5ceeea4da1179193c2c7ddcebfd67019128473e3. * Revert "* expand tabs." This reverts commit e021386e905b6d6799a84dfbc2f0592e42626366. * Revert "Import bigdecimal-1.4.0.pre-20181130a" This reverts commit a0e438cd3c28d2eaf4efa18243d5b6edafa14d88. * Revert "NEWS: write about bigdecimal updates" This reverts commit 89455ff2ba973f2a9ee7b79657e0e6f1f31501f9. * Revert "Fix rubyspec of bigdecimal for ruby <2.6" This reverts commit 4bcdeeb65e57de4da306d347652898c767162e74. * Revert "Fix rubyspec against bigdecimal updates" This reverts commit c8fb30fc9e0ee14e87be1e231869a12aaef1eedf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-04* expand tabs.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e