summaryrefslogtreecommitdiff
path: root/bignum.c
AgeCommit message (Collapse)Author
2011-01-27 * bignum.c (rb_str_to_inum): get rid of too huge alloca().kosaki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-07* bignum.c (bigmul1_karatsuba): avoid overflow that make assertionmatz
fail in certain case. this patch is contributed from Ray Chason <chasonr at gmail.com> in personal communication. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02* bignum.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-27* bignum.c (rb_big2long, rb_big2ulong): rb2ulong() returns VALUE, butusa
its real range is ulong. So, if the size of VALUE is bigger than ulong, upper bits are always zero even if the actual value is negative. fixed #3490 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29612 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-10* random.c (rb_genrand_ulong_limited): renamed fromnaruse
rb_rand_internal and now this is public API. * include/ruby/ruby.h (rb_genrand_ulong_limited): added. * bignum.c (big_sparse_p): use rb_genrand_ulong_limited. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-03* bignum.c (rb_big_eq): never equal to infinity.nobu
[ruby-core:31603] * rational.c (nurat_div): hack for integral float divisor. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-01* bignum.c (big_op): comparison of bignum and infinity has returned 1mame
or -1, but it must return boolean. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-25* bignum.c (bigmul1_karatsuba): suppress a warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-20* bignum.c (bigmul1_karatsuba): fix calculation order to preventmame
underflow. [ruby-core:29088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-25* bignum.c, node.h, strftime.c, enc/trans/utf8_mac.trans: added explicit ↵muraken
casts for supplessing warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-07* bignum.c (rb_big_pack): use DIGSPERLONG and BITSPERDIG.akr
(rb_big_unpack): use DIGSPERLONG. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-04add comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-27* pack.c: check assuption on QUAD_SIZE and SIZEOF_LONG.akr
* bignum.c: check assuption on SIZEOF_LONG and SIZEOF_BDIGITS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-26* pack.c: fix q and Q for big endian environments which have noakr
8 bytes integer type. (pack_pack): use rb_big_pack. (pack_unpack): use rb_big_unpack. * include/ruby/intern.h (rb_big_pack): declared. (rb_big_unpack): ditto. * bignum.c (rb_big_pack): new function. (rb_big_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-26* bignum.c: fix rb_quad_pack and rb_quad_unpack for environmentsakr
which don't have 8bytes integer type. This still depends on little endian. (rb_quad_pack): use quad_buf_complement. don't raise for large values. (rb_quad_unpack): use quad_buf_complement. (quad_buf_complement): new function extracted frm rb_quad_pack. add one after bitwise negation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-26* pack.c (QUAD_SIZE): it should be always 8.akr
* bignum.c (rb_quad_pack): use LONG_LONG version only if SIZEOF_LONG_LONG == QUAD_SIZE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-05* bignum.c (big_op): remove unused variables.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-04* bignum.c (big_gt, big_ge, big_lt, big_ge): added Bignum#>, >=, < andmame
<= to allow to compare with BigDecimal. [ruby-dev:40167] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-28* ext/bigdecimal/bigdecimal.c (BigDecimal_to_i): update RDoc tomatz
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
2010-01-18* bignum.c (bigsub_int): remove nonsense loop.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-29Add Float::INFINITY and Float::NAN.naruse
* numeric.c (Init_Numeric): Add Float::INFINITY and Float::NAN. [ruby-dev:1657] [ruby-dev:4760] [ruby-list:7023] [ruby-list:46690] [ruby-core:26632] [ruby-talk:41352] [ruby-talk:203333] * include/ruby/defines.h (INFINITY): defined. * include/ruby/defines.h (NAN): defined. * include/ruby/util.h (ruby_div0): removed. * numeric.c (fix_pow): use INFINITY and NAN instead of ruby_div0(1.0). * marshal.c (r_object0): ditto. * bignum.c (big_fdiv): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-26* removed spaces just before tabs.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25930 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-28* string.c: rdoc for <=>, casecmpmarcandre
* bignum.c: rdoc for <=> * file.c: ditto * time.c: ditto * compar.c: rdoc git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-17* bignum.c (big_split): fix off-by-one error. [ruby-dev:39501]mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-12fix rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-13* bignum.c (bigmul1_single): suppress a warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-08* include/ruby/st.h (st_hash_func): use st_index_t.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-04* bignum.c (rb_big_idiv): added rdoc.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-04* bignum.c (rb_big_div, rb_big_idiv): fixed indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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