summaryrefslogtreecommitdiff
path: root/bignum.c
AgeCommit message (Collapse)Author
2012-04-14* variable.c (trace_ev): Removed "not reached" comment as this line isdrbrain
reached. * variable.c (rb_obj_remove_instance_variable): Replaced "not reached" comment with the UNREACHABLE macro. * variable.c (rb_mod_const_missing): ditto. * variable.c (rb_mod_remove_cvar): ditto. * enum.c (first_i): ditto. * string.c (rb_str_aref): ditto. * string.c (str_byte_aref): ditto. * string.c (rb_to_id): ditto. * io.c (rb_io_fmode_modestr): ditto. * io.c (rb_io_oflags_modestr): ditto. * pack.c (num2i32): ditto. * vm_eval.c (rb_method_missing): ditto. * vm_eval.c (rb_f_throw): ditto. * dir.c (dir_read): ditto. * win32/win32.c (child_result): ditto. * struct.c (rb_struct_getmember): ditto. * struct.c (rb_struct_set): ditto. * struct.c (rb_struct_aref_id): ditto. * eval.c (rb_f_raise): ditto. * process.c (rb_f_exit_bang): ditto. * process.c (rb_f_exit): ditto. * process.c (rb_f_abort): ditto. * ext/-test-/iter/break.c (iter_break_value): ditto. * ext/pty/pty.c (pty_check): ditto. * ext/openssl/ossl_pkey.c (ossl_pkey_new): ditto. * ext/readline/readline.c (rb_remove_history): ditto. * ext/stringio/stringio.c (strio_unimpl): ditto. * numeric.c (num_sadded): ditto. * numeric.c (num_init_copy): ditto. * numeric.c (rb_num2ll): ditto. * numeric.c (rb_num2ull): ditto. * vm_insnhelper.c (call_cfunc): ditto. * ruby.c (opt_W_getter): ditto. * bignum.c (rb_big_coerce): ditto. * file.c (rb_f_test): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "controldrbrain
reaches end of non-void function" warnings. [ruby-trunk - Bug #6066] * re.c (name_to_backref_number): ditto. * object.c (rb_Float): ditto. * io.c (io_readpartial): ditto. * io.c (io_read_nonblock): ditto. * pack.c (rb_uv_to_utf8): ditto. * proc.c (rb_method_entry_arity): ditto. * vm_method.c (rb_f_notimplement): ditto. * struct.c (rb_struct_aset_id): ditto. * class.c (rb_scan_args): ditto. * process.c (rlimit_resource_type): ditto. * process.c (rlimit_resource_value): ditto. * process.c (p_uid_switch): ditto. * process.c (p_gid_switch): ditto. * ext/digest/digest.c (rb_digest_instance_update): ditto. * ext/digest/digest.c (rb_digest_instance_finish): ditto. * ext/digest/digest.c (rb_digest_instance_reset): ditto. * ext/digest/digest.c (rb_digest_instance_block_length): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto. * ext/dl/handle.c (rb_dlhandle_close): ditto. * ext/tk/tcltklib.c (pending_exception_check0): ditto. * ext/tk/tcltklib.c (pending_exception_check1): ditto. * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto. * ext/tk/tcltklib.c (lib_get_reltype_name): ditto. * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto. * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto. * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto. * ext/fiddle/conversions.c (generic_to_value): ditto. * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto. * ext/socket/socket.c (sock_s_getnameinfo): ditto. * ext/ripper/eventids2.c (ripper_token2eventid): ditto. * cont.c (return_fiber): ditto. * dmydln.c (dln_load): ditto. * vm_insnhelper.c (vm_search_normal_superclass): ditto. * bignum.c (big_fdiv): ditto. * marshal.c (r_symlink): ditto. * marshal.c (r_symbol): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-23* bignum.c (rb_str_to_inum): must be ASCII compatible encoding asnobu
well as String#hex and String#oct. [ruby-core:43566][Bug #6192] * string.c (rb_must_asciicompat): check if ASCII compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-18* bignum.c (rb_big_pow): estimate result bit size more precisely.nobu
[ruby-core:30735][Feature #3429] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-23update comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-05* bignum.c (big_rshift), compile.c (validate_label,nobu
iseq_build_from_ary_exception), cont.c (cont_capture), dir.c (dir_open_dir), gc.c (objspace_each_objects), io.c (pipe_open) (rb_io_advise), parse.y (parser_compile_string) (rb_parser_compile_file), proc.c (binding_free), process.c (rb_proc_exec_n, rb_seteuid_core, proc_setegid, rb_setegid_core) (p_uid_exchange, p_gid_exchange), regparse.c (strdup_with_null), signal.c (sig_dfl), vm.c (rb_iseq_eval, rb_iseq_eval_main), vm_insnhelper.c (vm_expandarray): suppress unused-but-set-variable warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-22* bignum.c (): refix of r33536. Don't change behavior of Bignum#/.naruse
[ruby-core:40429] [Bug #5490] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-16* bignum.c (rb_big2ulong): need to calc in unsigned long, becauseusa
the range of VALUE is larger than it on LLP64 platform, such as Win64. this change fixes the failures of test/-ext-/num2int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-16* bignum.c (rb_big2ull): add a cast to get rid of a VC++ warning.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14* bignum.c (rb_big2ull): fix 32bit platform breakage. we mustkosaki
not assume sizeof(VALUE) == sizeof(LONG_LONG). * test/-ext-/num2int/test_num2int.rb (class TestNum2int): fix false assumption on 32bit platform. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14* bignum.c (rb_big2ull): fix off-by-twice bug of NUM2ULL.kosaki
* test/-ext-/num2int/test_num2int.rb (class TestNum2int): fix a testcase too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-14* numeric.c (check_uint): fix off-by-one bug of NUM2UINT.kosaki
* bignum.c (rb_big2ulong): fix off-by-one bug of NUM2ULONG. * test/-ext-/num2int/test_num2int.rb: add a testcase for NUM2INT() NUM2UINT(), NUM2LONG(), NUM2ULONG(), NUM2LL and NUM2ULL(). * ext/-test-/num2int/depend: ditto. * ext/-test-/num2int/extconf.rb: ditto. * ext/-test-/num2int/num2int.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-27* bignum.c (rb_big_divide): raise ZeroDivisionError if divisor isnobu
zero, as well as Fixnum. [ruby-core:40429] [Bug #5490] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* use RB_TYPE_P which is optimized for constant types, instead ofnobu
comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-29* numeric.c (bit_coerce): A Fixnum and a Bignum are only permitted formrkn
bitwise arithmetic with a Fixnum. #1792 * test/ruby/test_fixnum.rb: add tests for the above change. * bignum.c (bit_coerce): A Fixnum and a Bignum are only permitted for bitwise arithmetic with a Bignum. #1792 * test/ruby/test_bignum.rb: add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-15* bignum.c (bigsub_int): add RB_GC_GUARD. This patch is made bymrkn
Makoto Kishimoto. fixes #4223 [ruby-dev:42907] * bignum.c (bigadd_int): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-29* bignum.c (bigmul1_toom3): remove unused variable.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-29* numeric.c (flo_round): fix for negative value.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22* bignum.c (dump_bignum, bigmul1_balance, big_split, biglsh_bang,mrkn
bigrsh_bang, big_split3, bigmul1_toom3, bigmul0): implement Toom3 (Toom-Cook) multiplication. * include/ruby/defines.h: add format prefixes for BDIGIT and BDIGIT_DBL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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