summaryrefslogtreecommitdiff
path: root/bignum.c
AgeCommit message (Collapse)Author
2007-12-24 * pack.c (pack_pack): use NUM2LONG instead of NUM2INT.usa
* numeric.c (fix_lshift, fix_aref): use SIZEOF_LONG instead of SIZEOF_VALUE. * bignum.c (big2ulong, rb_big_aref): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* bignum.c (rb_big_mul0): remove unused variable.matz
* bignum.c (bigdivrem): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14432 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* regerror.c, string.c, io.c, lib/getoptlong.rb, lib/net/imap.rb,akr
compile.c, sprintf.c, parse.y, ext/win32ole/win32ole.c, ext/tk/sample/demos-en/entry3.rb, ext/tk/lib/tcltk.rb, ext/openssl/ossl_bn.c, numeric.c, vm.c, benchmark/bm_so_meteor_contest.rb, bignum.c, ruby.c: don't "illegal" for non law violation context. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20* bignum.c (big2str_orig): access beyond memory region cause crashmatz
on interrupt. a patch from Yusuke ENDOH <mame AT tsg.ne.jp> in [ruby-dev:32651]. [ruby-dev:32641] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-19 * bignum.c (bigmul1): C99ism.usa
* bignum.c (bigdivrem1): need dummy return value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-19* bignum.c (rb_big_mul0): blocking check for bigger numbers.matz
a patch from Yusuke ENDOH <mame AT tsg.ne.jp> in [ruby-dev:32632]. * bignum.c (bigdivrem): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-19* bignum.c (rb_cstr_to_inum): an underscore succeeding after octalnobu
prefix is allowed. [ruby-core:14139] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-18* bignum.c (rb_cstr_to_inum): wrong radix check. a patch frommatz
Yusuke ENDOH <mame AT tsg.ne.jp> in [ruby-dev:32628]. * bignum.c (big2str_find_n1): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-04* bignum.c (rb_cstr_to_inum): trailing spaces may exist at sqeezingnobu
preceeding 0s. [ruby-core:13873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-27* bignum.c (big2str_find_n1): removed extraneous element.nobu
[ruby-dev:32351], [ruby-dev:32365] * bignum.c (big2str_find_n1): returns necessary digits now. * sprintf.c (remove_sign_bits): extends sign bit first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-16* bignum.c (rb_big_odd_p): new method added. a patch from Tadashimatz
Saito <shiba AT mail2.accsnet.ne.jp>. [ruby-dev:32305] * bignum.c (rb_big_even_p): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-13* include/ruby/ruby.h: introduce 2 macros:ko1
RFLOAT_VALUE(v), DOUBLE2NUM(dbl). Rename RFloat#value -> RFloat#double_value. Do not touch RFloat#double_value directly. * bignum.c, insns.def, marshal.c, math.c, numeric.c, object.c, pack.c, parse.y, process.c, random.c, sprintf.c, string.c, time.c: apply above changes. * ext/dl/mkcallback.rb, ext/json/ext/generator/generator.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-29* bignum.c: use SIZEOF_LONG instead of SIZEOF_ULONG which is notakr
defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-01* include/ruby/ruby.h (struct RBignum): embed digits in RBignum forakr
small bignums. * bignum.c: RBignum embeded digits implemented. * include/ruby/intern.h: declare rb_big_resize. * gc.c: don't free embedded digits. * numeric.c: replace direct bignum field accessor by abstract field accessor such as RBIGNUM(val)->sign to RBIGNUM_SIGN(val). * sprintf.c: ditto. * compar.c: ditto. * marshal.c: ditto. * random.c: ditto. * .gdbinit: support embedded small bignums. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25* encoding.c: provide basic features for M17N.matz
* parse.y: encoding aware parsing. * parse.y (pragma_encoding): encoding specification pragma. * parse.y (rb_intern3): encoding specified symbols. * string.c (rb_str_length): length based on characters. for older behavior, bytesize method added. * string.c (rb_str_index_m): index based on characters. rindex as well. * string.c (succ_char): encoding aware succeeding string. * string.c (rb_str_reverse): reverse based on characters. * string.c (rb_str_inspect): encoding aware string description. * string.c (rb_str_upcase_bang): encoding aware case conversion. downcase, capitalize, swapcase as well. * string.c (rb_str_tr_bang): tr based on characters. delete, squeeze, tr_s, count as well. * string.c (rb_str_split_m): split based on characters. * string.c (rb_str_each_line): encoding aware each_line. * string.c (rb_str_each_char): added. iteration based on characters. * string.c (rb_str_strip_bang): encoding aware whitespace stripping. lstrip, rstrip as well. * string.c (rb_str_justify): encoding aware justifying (ljust, rjust, center). * string.c (str_encoding): get encoding attribute from a string. * re.c (rb_reg_initialize): encoding aware regular expression * sprintf.c (rb_str_format): formatting (i.e. length count) based on characters. * io.c (rb_io_getc): getc to return one-character string. for older behavior, getbyte method added. * ext/stringio/stringio.c (strio_getc): ditto. * io.c (rb_io_ungetc): allow pushing arbitrary string at the current reading point. * ext/stringio/stringio.c (strio_ungetc): ditto. * ext/strscan/strscan.c: encoding support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-16* bignum.c (bigtrunc): RBIGNUM(x)->len may be zero. out of boundmatz
access. [ruby-dev:31404] * sprintf.c (rb_str_format): small float should not call rb_dbl2big(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-16* bignum.c (big_lshift): make shift offset long type.akr
(big_rshift): ditto. (rb_big_lshift): ditto. (big_rshift): ditto. [ruby-dev:31434] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-08* bignum.c (rb_big2str0): should not use RTEST for non-VALUE.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-08* bignum.c (rb_big2str0): should preserve sign mark.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-06* bignum.c (rb_big2str0): make Bignum#to_s even faster. a patchmatz
from Kenta Murata <muraken AT gmail.com>. [ruby-dev:31354] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-02* bignum.c (big2str_table): base cannot be 0 or 1.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-02* bignum.c (rb_big2str0): faster Bugnum#to_s using Karatsubamatz
algorithm. a patch from Yusuke ENDOH <mame AT tsg.ne.jp> in [ruby-dev:31312], slightly modified by Kenta Murata <muraken AT gmail.com> in [ruby-dev:31339]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-30* bignum.c (rb_big_aref): check for Bignum index range.nobu
[ruby-dev:31271] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-19* bignum.c (rb_big_lshift, rb_big_rshift): separated functionsnobu
to get rid of infinite recursion. fixed calculation in edge cases. [ruby-dev:31244] * numeric.c (rb_fix_lshift, rb_fix_rshift): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-18* bignum.c (rb_big_pow): refine overflow check. [ruby-dev:31242]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15* bignum.c (rb_big_pow): removed invariant variable. [ruby-dev:31236]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15* bignum.c (get2comp): do nothing for empty Bignum. [ruby-dev:31225]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15* bignum.c (rb_cstr_to_inum): check leading non-digits.nobu
[ruby-core:11691] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-14* bignum.c (get2comp): do nothing for empty Bignum. [ruby-dev:31225]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-28refine previous change.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-28* bignum.c (rb_big_hash): fix hash area.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-26 * include/ruby/ruby.h: IL32LLP64 support.usa
* bignum.c (bigfixize, rb_cstr_to_inum): ditto. * insns.def (opt_plus, opt_minus, opt_mult): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-10* include/ruby: moved public headers.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-09* bignum.c: purged trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-09* bignum.c (Init_Bignum), numeric.c (Init_Numeric): added fdiv asnobu
aliases of quo. [ruby-dev:30771] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-02* bignum.c (rb_big_quo): now calculate in integer. [ruby-dev:30753]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-01* bignum.c (rb_big_pow): improvement by calculating from MSB and usingnobu
factorization. <http://yowaken.dip.jp/tdiary/20070426.html#p01> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12236 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-26* bignum.c (rb_big_pow): truncate all zero BDIGITs. [ruby-dev:30733]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-04-26* bignum.c (rb_big_pow): reduce multiplying for even number.nobu
* numeric.c (int_pow): calculate power in Fixnum as possible. [ruby-dev:30726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-03-21* bignum.c (rb_big2str0): round up for the most significant digit.nobu
[ruby-core:10686] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-30* bignum.c (rb_big2str0): use better approximation.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-30* bignum.c (rb_big2str0): wrong allocation length.matz
[ruby-dev:29710] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-30* sprintf.c (rb_str_format): should preserve leading zeromatz
information for negative %b and %x. [ruby-talk:221347] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-07* bignum.c (rb_big_rshift): a bug in right shift of negativematz
bignums. [ruby-core:09020] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-21* bignum.c (rb_big_hash): use rb_memhash().matz
* numeric.c (flo_hash): simplified. klass need not to affect resulting hash value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04* numeric.c (fix_plus): addition in Fixnum will never overflowmatz
long. a patch from Ondrej Bilka <neleai at seznam.cz>. [ruby-core:08794] * numeric.c (fix_minus): ditto. * bignum.c (rb_big_pow): eagerly truncate resulting bignum. [ruby-core:08794] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31* ruby.h (struct RString): embed small strings.matz
(RSTRING_LEN): defined for accessing string members. (RSTRING_PTR): ditto. * string.c: use RSTRING_LEN and RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-11* bignum.c (rb_int2big): use SIGNED_VALUE. [ruby-dev:29019]matz
* bignum.c (rb_int2inum, rb_uint2inum): use VALUE sized integer. * bignum.c (rb_big2long, rb_big2ulong): ditto. * numeric.c (rb_num2long, rb_num2ulong): ditto. * numeric.c (check_int, check_uint): ditto. * bignum.c (rb_quad_pack): typo fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-11* bignum.c (bignorm): sizeof(long) may be smaller thanmatz
sizeof(VALUE). [ruby-dev:29013] * ruby.h (FIXNUM_MAX): fixnum may be bigger than long. * ruby.h (SIGNED_VALUE): signed integer of size of VALUE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-07-03* bignum.c: ruby 1.9 HEAD 64 bit warnings clean up frommatz
<ville.mattila at stonesoft.com>. [ruby-core:08120] * ChangeLog: remove some direct reference to mail addresses to prevent spams. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e