summaryrefslogtreecommitdiff
path: root/ext/bigdecimal
AgeCommit message (Collapse)Author
2014-11-21Update dependency.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15Mark auogenerated part.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* common.mk: Remove comments in Dependency lines.akr
Notified by usa. * enc/depend: Ditto. * ext/**/depend: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-15* tool/update-deps: Extend to fix dependencies.akr
* common.mk: Dependencies updated by tool/update-deps. * enc/depend: Ditto. * ext/**/depend: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-31* ext/bigdecimal/bigdecimal.c: [DOC] Add description ofmrkn
`BigDecimal.new` exceptions. Patched by @joker1007 and @prathamesh-sonpatki [Fixes GH-690] https://github.com/ruby/ruby/pull/690 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-28bigdecimal/math.rb: error message in BigMath#PInobu
* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath#PI): change error message about zero or negative precision for clarity and consistency with other methods. [GH-644] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-17* include/ruby/ruby.h: Hide Rational internal.akr
(RRational): Moved to internal.h (RRATIONAL): Ditto. (RRATIONAL_SET_NUM): Moved to rational.c. (RRATIONAL_SET_DEN): Ditto. * rational.c (rb_rational_num): New function. (rb_rational_den): Ditto. * include/ruby/intern.h (rb_rational_num): Declared. (rb_rational_den): Ditto. * ext/bigdecimal/bigdecimal.c: Follow the above change. * ext/date/date_core.c: Ditto. [ruby-core:60665] [Feature #9513] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45976 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-21class.c: do nothing if copying selfnobu
* class.c (rb_mod_init_copy): do nothing if copying self. [ruby-dev:47989] [Bug #9535] * hash.c (rb_hash_initialize_copy): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-16* ext/bigdecimal/bigdecimal.c (BigDecimal_initialize): Insert GC guard.mrkn
* ext/bigdecimal/bigdecimal.c (BigDecimal_global_new): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-16bigdecimal.c: refine macrosnobu
* ext/bigdecimal/bigdecimal.c (PUSH, SAVE): remove extra semicolons. * ext/bigdecimal/bigdecimal.c (GUARD_OBJ): add parentheses and make an expression instead of a statement. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-15* ext/bigdecimal/bigdecimal.c (BIGNUM_ZERO_P): Unused macro removed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-15* internal.h: Rename macro names: RBIGNUM_FOO to BIGNUM_FOO.akr
(BIGNUM_EMBED_LEN_NUMBITS): Renamed from RBIGNUM_EMBED_LEN_NUMBITS. (BIGNUM_EMBED_LEN_MAX): Renamed from RBIGNUM_EMBED_LEN_MAX. (BIGNUM_SIGN_BIT): Renamed from RBIGNUM_SIGN_BIT. (BIGNUM_SIGN): Renamed from RBIGNUM_SIGN. (BIGNUM_SET_SIGN): Renamed from RBIGNUM_SET_SIGN. (BIGNUM_POSITIVE_P): Renamed from RBIGNUM_POSITIVE_P. (BIGNUM_NEGATIVE_P): Renamed from RBIGNUM_NEGATIVE_P. (BIGNUM_EMBED_FLAG): Renamed from RBIGNUM_EMBED_FLAG. (BIGNUM_EMBED_LEN_MASK): Renamed from RBIGNUM_EMBED_LEN_MASK. (BIGNUM_EMBED_LEN_SHIFT): Renamed from RBIGNUM_EMBED_LEN_SHIFT. (BIGNUM_LEN): Renamed from RBIGNUM_LEN. (RBIGNUM_DIGITS): Renamed from RBIGNUM_DIGITS. (BIGNUM_LENINT): Renamed from RBIGNUM_LENINT. * bignum.c: Follow the above change. * gc.c: Ditto. * marshal.c: Ditto. * math.c: Ditto. * numeric.c: Ditto. * random.c: Ditto. * rational.c: Ditto. * sprintf.c: Ditto. * ext/-test-/bignum/bigzero.c: Ditto. * ext/-test-/bignum/intpack.c: Ditto. * ext/bigdecimal/bigdecimal.c: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-12bigdecimal.h: suppress warningsnobu
* ext/bigdecimal/bigdecimal.h (VpSetZero, VpSetInf): get rid of unused-value warnings by gcc 4.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11* ext/bigdecimal/bigdecimal.c (BigMath_s_log): Use rb_big_cmp instead ofakr
RBIGNUM_NEGATIVE_P. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11* bignum.c (rb_big_cmp): Specialize a comparison to zero.akr
* ext/bigdecimal/bigdecimal.c (is_negative): Use rb_big_cmp instead of RBIGNUM_NEGATIVE_P. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15* ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.5.mrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-15bigdecimal.c: rename macrosnobu
* ext/bigdecimal/bigdecimal.c (RB_OBJ_CLASSNAME): rename from CLASS_NAME(). * ext/bigdecimal/bigdecimal.c (RB_OBJ_STRING): for object itself. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-14bigdecimal.c: backword compatibility as gemnobu
* ext/bigdecimal/bigdecimal.c (CLASS_NAME): macro to wrap depending on PRIsVALUE for 1.9. [Backport #9406] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-14bigdecimal.c: backword compatibility as gemnobu
* ext/bigdecimal/bigdecimal.c (DECIMAL_SIZE_OF_BITS): fallback definition for 2.1 or older. [ruby-core:59750] [Backport #9406] * ext/bigdecimal/bigdecimal.c (raise_with_class): fallback definition for 1.9. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13* ext/bigdecimal/bigdecimal.c (BigDecimal_divide): Add an additionalmrkn
digit for the quotient to be compatible with bigdecimal 1.2.1 and the former. [ruby-core:59365] [#9316] [#9305] * test/bigdecimal/test_bigdecimal.rb: tests for the above change. * ext/bigdecimal/bigdecimal.gemspec: bigdecimal version 1.2.4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13ext: use PRIsVALUE for rb_raise and rb_warnnobu
* ext/bigdecimal/bigdecimal.c (BigDecimal_new): use PRIsVALUE for rb_raise() and rb_warn(). * ext/openssl/ossl_cipher.c (ossl_cipher_init): ditto. * ext/racc/cparse/cparse.c (extract_user_token): ditto. * ext/syslog/syslog.c (mSyslog_log): ditto. * ext/openssl/ossl.h (OSSL_Check_Kind, OSSL_Check_Instance): now ossl_raise() also accepts PRIsVALUE. * ext/openssl/ossl_asn1.c (ossl_asn1_default_tag): git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12ruby/util.h: DECIMAL_SIZE_OF_BITSnobu
* include/ruby/util.h (DECIMAL_SIZE_OF_BITS): a preprocessor constant macro to approximate decimal representation size of n-bits integer. * iseq.c (register_label): use DECIMAL_SIZE_OF_BITS for better approximation. * ext/bigdecimal/bigdecimal.c (BigMath_s_log): ditto. * common.mk (iseq.o), ext/bigdecimal/depend (bigdecimal.o): add dependency to ruby/util.h for DECIMAL_SIZE_OF_BITS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-11bigdecimal.c: expand buffernobu
* ext/bigdecimal/bigdecimal.c (BigMath_s_log): expand buffer size for 64bit platforms. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-02* ext/bigdecimal: update class method call style from :: to .eregon
in documentation and usage. * ext/bigdecimal/lib/bigdecimal/math.rb: [DOC] fix examples values. Computations were made using ruby 2.0.0p247 to ensure no effect of the recent BigDecimal bug. * ext/bigdecimal/sample/nlsolve.rb: fix indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-12* ext/bigdecimal/bigdecimal.c (VpSetPTR): fix for limitation of the resultingmrkn
precision. * test/bigdecimal/test_bigdecimal.rb (test_limit): add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-12* ext/bigdecimal/bigdecimal.c (VpAddAbs): put out a conditional branch frommrkn
the inside of while-loop. * ext/bigdecimal/bigdecimal.c (VpSubAbs): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-12* ext/bigdecimal/bigdecimal.c (VPrint): be a static function, support anothermrkn
dump formats, and add more information of the given bigdecimal. * ext/bigdecimal/bigdecimal.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-08* bigdecimal.c (BigDecimal_coerce): convert a Float to a BigDecimal insteadmrkn
of converting the receiver to a Float. [ruby-core:58756] [Bug #9192] * test/bigdecimal/test_bigdecimal.rb: add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-05* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec):mrkn
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-11-26bigdecimal.gemspec: datenobu
* ext/bigdecimal/bigdecimal.gemspec: revert Gem::Specification#date for snapshot/release tarballs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43848 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-25* ext/bigdecimal/bigdecimal.gemspec: bump BigDecimal to 1.2.3 forzzak
proper release date in RubyGems git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-25* ext/bigdecimal/bigdecimal.gemspec: Remove Gem::Specification#datezzak
We should rely on rubygems to create the date the gem was released for each version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23* ext/bigdecimal/bigdecimal.c (BigDecimal_power): Use FIX2LONG insteadmrkn
of FIX2INT to avoid conversion error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23* ext/bigdecimal/lib/bigdecimal/math.rb (BigMath.E): Use BigMath.exp.mrkn
[Feature #6857] [ruby-core:47130] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23expmrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-23* ext/bigdecimal/bigdecimal.c (BigDecimal_div2): The signature wasmrkn
changed to allow us to pass arguments directly. * ext/bigdecimal/bigdecimal.c (BigDecimal_div3): Added for the role of the old BigDecimal_div2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* ext/bigdecimal/bigdecimal.c (BigDecimal_power):mrkn
Round the result value only if the precision is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* ext/bigdecimal/bigdecimal.gemspec: version 1.2.2.mrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* ext/bigdecimal/bigdecimal.c (BigDecimal_data_type):mrkn
Use RUBY_TYPED_FREE_IMMEDIATELY only if it is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* ext/bigdecimal/bigdecimal.c (BigDecimal_power): Round the result value.mrkn
[Bug #8818] [ruby-core:56802] * test/bigdecimal/test_bigdecimal.rb: Add a test for the above fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Insert rb_thread_check_ints.mrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix the inserting pointsmrkn
of RB_GC_GUARDs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22* ext/bigdecimal/bigdecimal.c: Fix indentation.mrkn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21* ext/bigdecimal/bigdecimal.c (VpAlloc): Fix the expr to adjust the sizemrkn
of the digit array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21* ext/bigdecimal/bigdecimal.c (BigDecimal_sqrt): Fix the precision ofmrkn
the result BigDecimal of sqrt. [Bug #5266] [ruby-dev:44450] * test/bigdecimal/test_bigdecimal.rb: add tests for the above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-14* ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] remove example ofnagachika
Rational#to_d without argument. [Bug #8958] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13* ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] +precision+ is requiredzzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13* ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] Document the requiredzzak
+precision+ argument for Rational#to_d [Bug #8958] -This line, and those below, will be ignored-- M ChangeLog M ext/bigdecimal/lib/bigdecimal/util.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* add RUBY_TYPED_FREE_IMMEDIATELY to data types which only useko1
safe functions during garbage collection such as xfree(). On default, T_DATA objects are freed at same points as fianlizers. This approach protects issues such as reported by [ruby-dev:35578]. However, freeing T_DATA objects immediately helps heap usage. Most of T_DATA (in other words, most of dfree functions) are safe. However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default for safety. * cont.c: ditto. * dir.c: ditto. * encoding.c: ditto. * enumerator.c: ditto. * error.c: ditto. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * iseq.c: ditto. * marshal.c: ditto. * parse.y: ditto. * proc.c: ditto. * process.c: ditto. * random.c: ditto. * thread.c: ditto. * time.c: ditto. * transcode.c: ditto. * variable.c: ditto. * vm.c: ditto. * vm_backtrace.c: ditto. * vm_trace.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * ext/objspace/objspace.c: ditto. * ext/stringio/stringio.c: ditto. * ext/strscan/strscan.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26* ext/bigdecimal/bigdecimal.c: [DOC] several fixes by @chastellzzak
This includes fixing the capitalization of Infinity, return value of example "BigDecimal.new('NaN') == 0.0", and code style in example. [Fixes GH-398] https://github.com/ruby/ruby/pull/398 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e