summaryrefslogtreecommitdiff
path: root/bignum.c
AgeCommit message (Collapse)Author
2009-08-30* bignum.c (bigmul1_single): new function specialized respect toakr
multiply two single digit bignums. (bigmul0): use bigmul1_single. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-25* bignum.c (rb_big_clone, bigmul1_normal, bigdivrem): trivialnobu
optimization. * bignum.c (big2dbl): truncates zero digits to get rid of possible underflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-16 * numeric.c (flo_pow,fix_pow): may return complex number.tadf
* bignum.c (rb_big_pow): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-12* insns.def, vm.c, vm_insnhelper.c, vm_insnhelper.h: checkko1
definition of (classes)#=== for case/when optimization. Fix Bug #1376 [ruby-core:23190]. * string.c (Init_String), bignum.c (Init_Bignum), numeric.c (Init_Numeric): define String#===, Symbol#===, Bignum#===, Fixnum#===, Float#=== as same as (classes)#==. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-09* bignum.c (rb_big_cmp, bigsub, big_real_len, bigmul1_normal,mame
bigmul1_balance, big_split): remove BDIGITS() inside of the loops. same as r24444. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-08* bignum.c (bigzero_p): removing BDIGITS() inside of thematz
loop. inspired by Hitohiro Kanai's blog entry <http://d.hatena.ne.jp/CanI/20090807/1249657492>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-18* suppressed shorten-64-to-32 warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-16* bignum.c (rb_big_new, rb_bigzero_p), range.c (rb_range_values):nobu
added for random.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-18* bignum.c (big_lshift, big_rshift): return Bignum always withoutnobu
normalization. [ruby-dev:38679] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-17* numeric.c (flo_cmp): Infinity is greater than any bignummatz
number. [ruby-dev:38672] * bignum.c (rb_big_cmp): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-17 * bignum.c (rb_big_fdiv): checks whether the given second argumenttadf
can be converted to float properly. * numeric.c (fix_fdiv): calls rb_big_fdiv when the given second argument is a bignum. * rational.c (nurat_fdiv): should calculate Float(x/y), not Float(x)/Float(y). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-15avoid signbit() and adjust indentation.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-15 * bignum.c (rb_big2db): (-Float::MAX.to_i*2).to_f should returntadf
-HUGE_VAL (-Infinity). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-27* bignum.c (bigand_int): new function to calculate bignum andmatz
fixnum without allocating internal bignum. * bignum.c (bigor_int): ditto. * bignum.c (bigxor_int): ditto. * bignum.c (bigand_int): even less object allocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23596 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-26* common.mk (bignum.o, numeric.o): depend on util.h.nobu
* bignum.c, marshal.c: fixed types. * numeric.c (infinite_value): use ruby_div0. * include/ruby/util.h (ruby_div0): moved from marshal.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-26* bignum.c (bignew_1): inline memory allocation.matz
* bignum.c (bigtrunc): call rb_big_resize() only when needed. * bignum.c (bigfixize): declare inline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-20* bignum.c (bigsub_int): subtraction without making internalmatz
bignum values. * bignum.c (bigadd_int): ditto for addition. * bignum.c (bigtrunc): declare inline. * bignum.c (rb_quad_pack): fix condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-26* bignum.c (rb_cmpint): FIX2INT may fail on LP64 platforms.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-13* bignum.c (bigfixize): zero length Bignum is 0.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-12* array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,nobu
numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-10* array.c, bignum.c, gc.c, numeric.c, string.c, util.c, insns.def,nobu
missing/crypt.c, missing/vsnprintf.c, : suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-22stripped trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 * bignum.c (rb_cstr_to_inum): changed an error message.tadf
* complex.c (string_to_c_strict): ditto. * rational.c (string_to_r_strict): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-14* bignum.c (bigmul1_karatsuba): remove temporal bignum.mame
* bignum.c (bigsqr): call bigmul0(x, x) because it is faster than the original bigsqr at this point. * bignum.c (rb_big_pow): a value returned from bigsqr is already truncated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-14* bignum.c (bigmul1_karatsuba): fix comment and refactoring.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-14* bignum.c (bigmul1_balance, bigmul1_karatsuba): remove allmame
rb_gc_force_recycle which causes memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-14* bignum.c (rb_big_mul): faster multiplication by Karatsuba method andmame
twice faster square than normal multiplication. * random.c (rb_rand_internal): used by Bignum#*. * test/ruby/test_bignum.rb: add some tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-19 * complex.c: uses f_(in)?exact_p macro.tadf
* rational.c: ditto. * bignum.c (rb_big_pow): bignum**bignum - should calculate without rational. * lib/complex.rb: should override Math module at most once. * lib/mathn.rb: requires 'cmath' directly. -この行以下は無視されます -- M complex.c M ChangeLog M lib/mathn.rb M lib/complex.rb M bignum.c M rational.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-18* bignum.c (big2str_karatsuba): free internal buffer eagerly.matz
a patch from TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in [ruby-dev:36217]. * bignum.c (rb_big2str0): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19414 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15* gc.c, include/ruby/ruby.h: rename rb_register_mark_object()ko1
to rb_gc_register_mark_object(). * eval.c, vm.c: initialize vm->mark_object_ary at Init_top_self(). * bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c, io.c, load.c, marshal.c, rational.c, ruby.c, vm.c: use rb_gc_register_mark_object() instead of rb_global_variable() or rb_gc_register_address(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-11* bignum.c (bigdivrem): adjust length for division and remainder.matz
a patch from TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in [ruby-dev:36231]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-11* bignum.c (big2str_karatsuba): remove unnecessary fixnum code. amatz
patch from TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in [ruby-dev:36217]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05* bignum.c (bigdivrem1): optimization by skipping zeros at thematz
tail of digits. a patch from TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in [ruby-dev:36169]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05* include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.matz
a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in [ruby-dev:36102]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-29* bignum.c (bigdivmod): remove redundant code. a patch frommatz
TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in [ruby-dev:36044]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-29 * bignum.c: added an alias (#magnitude).tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08* array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko1
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c, io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c, string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c, vm.c, gc.c: allocated memory objects by xmalloc (ruby_xmalloc) should be freed by xfree (ruby_xfree). * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c, ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c, ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-12* bignum.c (bigzero_p): check from MSB to LSB. [ruby-dev:34649]akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-08* bignum.c (rb_big_and): bit-wise operation should not take floatmatz
values. [ruby-dev:34612] * bignum.c (rb_big_or): ditto. * bignum.c (rb_big_xor): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16335 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07* bignum.c (rb_big_fdiv): flo.fdiv(NaN) should result NaN.matz
* numeric.c (num_quo): renamed and moved from bignum.c. [ruby-dev:34582] * bignum.c (rb_big_fdiv): update RDoc description * rational.c (nurat_s_new_m): small refactoring. * bignum.c (rb_big2dbl): no need for forceful warning when converting to float. overflow is a nature of float values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-01* bignum.c (rb_big_divide), numeric.c (fix_divide): check for resultnobu
domain. [ruby-dev:34559] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-01* bignum.c (rb_big_divide): return an integer for idiv.nobu
[ruby-dev:34553] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-07 * numeric.c: cancelled recent changes (except to remove rdiv).tadf
* bignum.c: ditto. * bignum.c: added rb_big_idiv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-06* bignum.c (rb_cmpint): moved from compar.c, to check bignummatz
zero. * range.c (range_step): add step for each iteration if begin and end are numeric. [ruby-core:15990] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-03* bignum.c (Init_Bignum): rdiv method removed. [ruby-dev:34242]matz
* complex.c (nucomp_quo): ditto. * numeric.c (num_rdiv): ditto. * rational.c (nurat_div): ditto. * complex.c (nucomp_fdiv): fdiv implementation restored. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-01* bignum.c (big2dbl): more precise conversion at edge cases.nobu
[ruby-dev:34195] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-31* numeric.c (num_quo): should convert its operand to Rational.matz
* rational.c (string_to_r_strict): should raise TypeError. * bignum.c (Init_Bignum): should not redefine Bignum#div. Numeric#div will do. [ruby-dev:34066] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-19* bignum.c (rb_cstr_to_inum): treat successive underscores asnobu
nondigit. [ruby-dev:34089] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-16both complex and rational are now builtin classes.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-09fix doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e