summaryrefslogtreecommitdiff
path: root/bignum.c
AgeCommit message (Collapse)Author
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
2008-03-07* bignum.c: fix indent.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-07* bignum.c (power_cache_init, power_cache_get_power0, Init_Bignum):mame
delayed initializing power cache per base. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-05* numeric.c (fix_to_s): avoid rb_scan_args() when no argumentmatz
given. * bignum.c (rb_big_to_s): ditto. * enum.c (enum_first): ditto. * eval_jump.c (rb_f_catch): ditto. * io.c (rb_obj_display): ditto. * class.c (rb_obj_singleton_methods): ditto. * object.c (rb_class_initialize): ditto. * random.c (rb_f_srand): ditto. * range.c (range_step): ditto. * re.c (rb_reg_s_last_match): ditto. * string.c (rb_str_to_i): ditto. * string.c (rb_str_each_line): ditto. * string.c (rb_str_chomp_bang): ditto. * string.c (rb_str_sum): ditto. * string.c (str_modifiable): declare inline. * string.c (str_independent): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29* bignum.c (big2str_find_n1): check integer overflow.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-25 * bignum.c (big2str_karatsuba): initialize cache if not initialized.usa
* bignum.c (Init_Bignum): delayed initializing cache. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15598 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-22* bignum.c (BIGZEROP): fix for longer Bignum zeros. [ruby-Bugs-17454]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15575 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-12* numeric.c (rb_num_coerce_bin): add ID argument to specifymatz
caller's method name. [ruby-dev:33663] * numeric.c (rb_num_coerce_cmp): ditto. * numeric.c (rb_num_coerce_relop): ditto. * ext/bigdecimal/bigdecimal.c (DoSomeOne): add function name argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-30adjustmenttadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-30 * bignum.c (rb_cstr_to_inum): '0_2' is a valid representatin.tadf
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-29* bignum.c: move object allocation out of blocking_region.mame
[ruby-dev:33139] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-28 * bignum.c (rb_big2str0): should be US-ASCII.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-25* string.c (rb_str_usascii_new{,2}: defined.naruse
(rb_str_new): set US-ASCII and ENC_CODERANGE_7BIT when empty string. * encoding.c (rb_usascii_encoding, rb_usascii_encindex): defined. (rb_enc_inspect, enc_name, rb_locale_charmap, rb_enc_name_list_i): use rb_str_ascii_new. * array.c (recursive_join, inspect_ary): ditto. * object.c (nil_to_s, nil_inspect, true_to_s, false_to_s, rb_mod_to_s): ditto. * hash.c (inspect_hash, rb_hash_inspect, rb_f_getenv, env_fetch, env_clear, env_to_s, env_inspect): ditto. * numeric.c (flo_to_s, int_chr, rb_fix2str): ditto. * bignum.c (rb_big2str): ditto. * file.c (rb_file_ftype, rb_file_s_dirname, rb_file_s_extname, file_inspect_join, Init_file): ditto. * test/ruby/test_ruby_m17n.rb: add checks for encoding of string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-21* bignum.c (big_shift): fix a bug that caused infinite loop whenmame
left shifting. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06* $Date$ keyword removed to avoid inclusion of locale dependentakr
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-02* bignum.c (conv_digit): use ISDIGIT, ISLOWER and ISUPPER.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-02don't need to include ruby/util.h.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-02* util.c (ruby_strtoul): locale independent strtoul is implemented toakr
avoid "i".to_i(36) cause 0 under tr_TR locale. This is newly implemented, not a copy of missing/strtoul.c. * include/ruby/ruby.h (ruby_strtoul): declared. (STRTOUL): defined to use ruby_strtoul. * bignum.c, pack.c, ext/socket/socket.c: use STRTOUL. * configure.in (strtoul): don't check. * missing/strtoul.c: removed. * include/ruby/missing.h (strtoul): removed. * common.mk (strtoul.o): removed. * LEGAL (missing/strtoul.c): removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-31fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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