summaryrefslogtreecommitdiff
path: root/ext/bigdecimal
AgeCommit message (Collapse)Author
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
2013-09-12Eliminate less-than-zero checks for unsigned variablesnobu
* ext/bigdecimal/bigdecimal.c, ext/digest/md5/md5.c, ext/json/fbuffer/fbuffer.h, ext/json/generator/generator.c: Eliminate less-than-zero checks for unsigned variables. According to section 4.1.5 of C89 standard, size_t is an unsigned type. These checks were found with 'cppcheck' static analysis tool. [ruby-core:57117] [Feature #8890] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-15* ext/bigdecimal/lib/bigdecimal/util.rb: [DOC] document top-levelzzak
classes from BigDecimal utils native extensions git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-01* ext/bigdecimal/bigdecimal.h (RB_UNUSED_VAR, UNREACHABLE):mrkn
import macros from ruby.h for 1.9.3. [Bug #8588] [ruby-core:55730] * ext/bigdecimal/bigdecimal.gemspec: Bump version to 1.2.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-26* ext/bigdecimal/bigdecimal.c (BigDecimal_save_rounding_mode): fix typo.charliesome
Fixes GH-343. Patch by @jgarber. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-25* ext/bigdecimal/bigdecimal.c (BigMath_s_exp): Fix for the cases whenmrkn
the argument x is not a BigDecimal. This change is based on the patch made by Garth Snyder. [Fix GH-332] https://github.com/ruby/ruby/pull/332 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-20* ext/bigdecimal: Workaround fix for bigdecimal test failures causedakr
by [ruby-dev:47413] [Feature #8509] * ext/bigdecimal/bigdecimal.h (BDIGIT): Make it independent from the definition for bignum.c. (SIZEOF_BDIGITS): Ditto. (BDIGIT_DBL): Ditto. (BDIGIT_DBL_SIGNED): Ditto. (PRI_BDIGIT_PREFIX): Undefine the definition. (PRI_BDIGIT_DBL_PREFIX): Ditto. * ext/bigdecimal/bigdecimal.c (RBIGNUM_ZERO_P): Use rb_bigzero_p. (bigzero_p): Removed. (is_even): Use rb_big_pack. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-15* ext/bigdecimal/bigdecimal.c: Update overview formatting of headerszzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-15* ext/bigdecimal/bigdecimal.gemspec: Update authorszzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-13* ext/bigdecimal/*: improve documentation, nodoc samples with @mrknzzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04* ext/bigdecimal/lib/bigdecimal/util.rb (Float#to_d): fix the numbermrkn
of figures. Patch by Vipul A M <vipulnsward@gmail.com>. https://github.com/ruby/ruby/pull/323 fix GH-323 * test/bigdecimal/test_bigdecimal_util.rb: fix for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-31* ext/bigdecimal/bigdecimal.c (BigDecimal_power): use rb_dbl2bigmrkn
to convert a double value to a Bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19* ext/bigdecimal/bigdecimal.c: Formatting for BigMath [Fixes GH-306]zzak
Based on a patch by @eLobato. * ext/bigdecimal/lib/bigdecimal/math.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-19fix typos. Patch by k_takata.ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13* lib/mkmf.rb: Add ruby/ruby.h, ruby/missing.h, ruby/intern.h,akr
ruby/st.h and ruby/subst.h for ruby_headers in generated Makefile. * ext/-test-/old_thread_select/depend: Update dependencies. * ext/-test-/wait_for_single_fd/depend: Ditto. * ext/bigdecimal/depend: Ditto. * ext/curses/depend: Ditto. * ext/digest/bubblebabble/depend: Ditto. * ext/digest/depend: Ditto. * ext/digest/md5/depend: Ditto. * ext/digest/rmd160/depend: Ditto. * ext/digest/sha1/depend: Ditto. * ext/digest/sha2/depend: Ditto. * ext/dl/callback/depend: Ditto. * ext/dl/depend: Ditto. * ext/etc/depend: Ditto. * ext/nkf/depend: Ditto. * ext/objspace/depend: Ditto. * ext/pty/depend: Ditto. * ext/readline/depend: Ditto. * ext/ripper/depend: Ditto. * ext/sdbm/depend: Ditto. * ext/socket/depend: Ditto. * ext/stringio/depend: Ditto. * ext/strscan/depend: Ditto. * ext/syslog/depend: Ditto. * ext/-test-/num2int/depend: Removed. * ext/dbm/depend: Ditto. * ext/fcntl/depend: Ditto. * ext/gdbm/depend: Ditto. * ext/racc/cparse/depend: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e