aboutsummaryrefslogtreecommitdiffstats
path: root/ext/bigdecimal
Commit message (Collapse)AuthorAgeFilesLines
* * ext/bigdecimal/lib/bigdecimal/util.rb: Improve documentation. Patchdrbrain2011-05-201-18/+45
| | | | | | | by Pete Higgins. [Ruby 1.9 - Bug #4746] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/jacobian.rb: Document isEqual. Patchdrbrain2011-05-201-2/+2
| | | | | | | by Kuba Fietkiewicz. [Ruby 1.9 - Bug #4744] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.nobu2011-05-151-5/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cancel subversion backfire. sorrymatz2011-03-071-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gc.c (rb_gc_set_params): allow GC parameter configuration bymatz2011-03-071-4/+4
| | | | | | | environment variables. based on a patch from funny-falcon at https://gist.github.com/856296, but honors safe level. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpMemAlloc): CVE-2011-0188.mrkn2011-03-011-4/+4
| | | | | | Fixes a bug reported by Drew Yao <ayao at apple.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/bigdecimal/bigdecimal.h: suppress "warning: 'VPrint' declared 'static' ↵kazu2010-12-111-1/+1
| | | | | | but never defined". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/util.rb (to_digits): avoid unusedmrkn2010-11-161-1/+1
| | | | | | variables warning, reported by Aaron Patterson. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BIGDECIMAL_ENABLE_VPRINT):mrkn2010-09-291-0/+5
| | | | | | VPrint is usually disabled. It's only used in debugging. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_save_limit):mrkn2010-09-291-1/+1
| | | | | | | | return the result of a block. * test/bigdecimal/test_bigdecimal.rb (test_save_limit): add a test for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_save_rounding_mode):mrkn2010-09-291-1/+1
| | | | | | | | | | return the result of a block. * test/bigdecimal/test_bigdecimal.rb (test_save_rounding_mode): add a test for the above change. * test/bigdecimal/test_bigdecimal.rb (test_save_exception_mode): add a test for the return value of BigDecimal.save_exception_mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_div2, BigDecimal_add2,usa2010-09-291-5/+5
| | | | | | | | BigDecimal_sub2, BigDecimal_mult2, VpLimitRound): remove meaningless casts to get rid of compiler warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VPrint, VpToString): fix format.nobu2010-09-291-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (check_rounding_mode, BigDecimal_mode):mrkn2010-09-191-3/+3
| | | | | | | | raise ArgumentError instead of TypeError passing invalid modes. * test/bigdecimal/test_bigdecimal.rb (test_mode, test_round): change against the above modifications. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29304 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (check_rounding_mode): added formrkn2010-09-181-61/+112
| | | | | | | | | | converting symbol to rounding mode number. * ext/bigdecimal/bigdecimal.c (BigDecimal_mode, BigDecimal_round): support to specify rounding mode by symbol. * test/bigdecimal/test_bigdecimal.rb (test_mode, test_round): add tests for avobe changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c: fix rounding algorithms for half-downmrkn2010-09-181-54/+111
| | | | | | | | and half-even. This change is based on the patch created by Matthew Willson, the reporter of this bug. [Bug #3803] [ruby-core:32136] * test/bigdecimal/test_bigdecimal.rb: add tests for above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_save_exception_mode,mrkn2010-08-281-0/+46
| | | | | | | | BigDecimal_save_rounding_mode, BigDecimal_save_limit): added. * test/bigdecimal/test_bigdecimal.rb: added tests for the above features. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (Init_bigdecimal, ↵mrkn2010-08-262-37/+119
| | | | | | | | | | | | rmpd_set_thread_local_exception_mode, VpGetException, VpSetException): thread-local exception mode. * ext/bigdecimal/bigdecimal.c (Init_bigdecimal, rmpd_set_thread_local_precision_limit, VpGetPrecLimit, VpSetPrecLimit): thread-local precision limit. * ext/bigdecimal/bigdecimal.c (Init_bigdecimal, rmpd_set_thread_local_rounding_mode, VpGetRoundMode, VpSetRoundMode, VpException, VpInternalRound): thread-local rounding mode. * ext/bigdecimal/bigdecimal.c (BigDecimal_mode, BigDecimal_round, VpIsRoundMode, VpGetRoundMode, VpSetRoundMode, VpActiveRound, VpMidRound, VpLeftRound), ext/bigdecimal/bigdecimal.h: use unsigned short for rounding mode. * test/bigdecimal/test_bigdecimal.rb (test_mode): add test for setting rounding mode. * test/bigdecimal/test_bigdecimal.rb (test_thread_local_mode): add test for setting mode thread-locally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_to_f): to_f must underflow when ↵mrkn2010-08-231-9/+24
| | | | | | | | the exponent is less than DBL_MIN_10_EXP - BASE_FIG. * test/bigdecimal/test_bigdecimal.rb (test_to_f): added test for the above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.h (llabs): never never never never neverusa2010-08-162-3/+3
| | | | | | | | | use "long long". * ext/bigdecimal.bigdecimal.c (BigDecimal_to_i): get rid of a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_inspect, VPrint, ↵mrkn2010-08-151-13/+13
| | | | | | VpToString, VpVarCheck): use PRIuSIZE, PRIdSIZE, PRIdVALUE, and PRIxVALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.h (VpVtoD): fix a type of e.mrkn2010-08-152-3/+3
| | | | | | * ext/bigdecimal/bigdecimal.c (BigDecimal_dump, BigDecimal_inspect): fix format for size_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/extconf.rb, ext/bigdecimal/bigdecimal.h (labs, llabs): ↵mrkn2010-08-143-314/+334
| | | | | | | | | support environments missing labs and llabs. * ext/bigdecimal/bigdecimal.h (vabs): added. * ext/bigdecimal/extconf.rb, ext/bigdecimal/bigdecimal.h, ext/bigdecimal/bigdecimal.c, test/bigdecimal/test_bigdecimal.rb (TestBigDecimal#test_new): replace U_LONG, S_LONG, S_INT, and U_INT with appropreate standard or ruby-provided types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c: don't use // comment.mrkn2010-08-111-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c, ext/bigdecimal/bigdecimal.h, ↵mrkn2010-08-103-298/+276
| | | | | | | | ext/bigdecimal/extconf.rb: BASE and BASE_FIG are defined based on the size of BDIGIT and renamed. * ext/bigdecimal/bigdecimal.c, ext/bigdecimal/bigdecimal.h: use BDIGIT for Real#frac. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.h, ext/bigdecimal/bigdecimal.c: add extern ↵mrkn2010-08-102-3/+6
| | | | | | declaration of rb_cBigDecimal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* .cvsignore: have not been used already. [Bug #3468]nobu2010-08-071-4/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_hash): fix type warnings.nobu2010-08-021-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_hash): use rb_memhash and take ↵mrkn2010-08-011-6/+3
| | | | | | care of negative finite numbers properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu2010-07-181-1/+1
| | | | | | | | add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (Init_bigdecimal): add two new constants ↵mrkn2010-07-032-1/+17
| | | | | | | | BigDecimal::INFINITY and BigDecimal::NAN. * ext/bigdecimal/lib/bigdecimal/math.rb (BigMath.exp): modify the behaviors for infinity arguments as same as Math.exp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28533 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#log): improvednobu2010-05-121-2/+4
| | | | | | | precision and performance. [ruby-dev:41295] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/lib/bigdecimal/math.rb (atan), ↵mrkn2010-05-111-1/+1
| | | | | | test/bigdecimal/test_bigmath.rb (test_atan): explicitly specify the precision for calculating a reciprocal number of an argument. [Bug #3267] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpAlloc): ensure buf does not getnobu2010-05-081-2/+3
| | | | | | | collected. based on a patch masaya tarui at [ruby-dev:41213]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpCtoV): fix to check overflow.naruse2010-05-061-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_IsInfinite): don't usenobu2010-05-011-1/+1
| | | | | | | non-ascii character. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal: fixed types.nobu2010-04-282-54/+53
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.def: unnecessary.nobu2010-04-261-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c: suppressed warnings.nobu2010-04-261-8/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/**/*.[ch]: removed trailing spaces.nobu2010-04-221-9/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.[ch]: replace _DEBUG with BIGDECIMAL_DEBUG to ↵mrkn2010-04-212-56/+56
| | | | | | prevent activating debugging code when compiled with -DEBUG flag on Windows. [ruby-core:22989] #1308 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_coerce): revert r23389,mame2010-04-161-7/+2
| | | | | | | which not only is unnecessary but also causes the inconsistency of return type. [ruby-core:25706] [Bug #2129] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_{to_i,mod,divmod,div2}):nobu2010-03-171-7/+1
| | | | | | | removed unused variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (VpCtoV): keep e's sign.naruse2010-03-161-0/+1
| | | | | | | When e doesn't over flow e * BASE_FIG but overflow e * 10, e will overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_divide): fix precision too.mame2010-02-091-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): fix precision.mame2010-02-091-2/+3
| | | | | | [ruby-core:17472][ruby-dev:35372][ruby-dev:40105][ruby-dev:40358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): get red ofmame2010-02-031-1/+0
| | | | | | floating point exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26565 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod): fix infinitymame2010-02-031-1/+16
| | | | | | handling. 1 / Infinity was evaluated to NaN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_to_i): update RDoc tomatz2010-01-281-26/+19
| | | | | | | | | | | denote that #to_i raises FloatDomainError for Inf and NaN. * ext/bigdecimal/bigdecimal.c (BigDecimal_to_i): fast #to_i using BigDecimal_split(). * bignum.c (conv_digit): use faster ISDIGIT() assuming ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/bigdecimal/bigdecimal.c (BigDecimal_DoDivmod, BigDecimal_mod,mame2010-01-261-16/+18
| | | | | | | BigDecimal_divmod, BigDecimal_div2): BigDecimal#% and #div returned an array itself that was returned by #divmod. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e