matz
98183a08c7
* dln.c: newer BeOS support. a patch from Pete Goodeve
...
<pete.goodeve at computer.org> in [ruby-core:18712].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@19424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-19 00:32:22 +00:00
usa
61a2d6baf3
Sat Jul 19 00:27:58 2008 NAKAMURA Usaku <usa@ruby-lang.org>
...
* numeric.c (check_uint, rb_num2uint, rb_fix2uint): fixed wrong check
about 64bit positive value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18129 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-18 15:41:47 +00:00
usa
b4e3812104
* numeric.c (check_uint, rb_num2uint, rb_fix2uint): strict check.
...
fixed [ruby-dev:33683]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-17 01:32:58 +00:00
usa
972769ca8e
* numeric.c (check_uint): sorry, backport misstake.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-04 11:21:35 +00:00
usa
5b3dd029bd
* numeric.c (check_uint, rb_num2uint, rb_fix2uint): proper check.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-04 08:54:47 +00:00
usa
f15ac284c5
* numeric.c (rb_fix2uint): typo.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-03 20:05:54 +00:00
usa
654a54a664
* numeric.c (check_uint, rb_num2uint): also needs checking negative
...
value. see [ruby-dev:33683]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-03 17:38:41 +00:00
akr
8f521e4af9
forgot to commit.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@17752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-30 16:04:04 +00:00
nobu
1378795e08
* suppress warnings with -Wwrite-string.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-31 09:28:20 +00:00
knu
78287c3d2e
* numeric.c (flo_divmod): Revert the behavior change; do not
...
suppress an exception when div is NaN or Inf. [ruby-dev:34857]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-27 10:49:42 +00:00
knu
125d830eb8
* array.c (rb_ary_collect_bang, rb_ary_select): Return an
...
enumerator if no block is given.
* dir.c (dir_each, dir_foreach): Return an enumerator if no block
is given.
* enum.c (enum_partition, enum_sort_by): Ditto.
* gc.c (os_each_obj): Ditto.
* hash.c (rb_hash_delete_if, rb_hash_reject_bang, rb_hash_select,
rb_hash_each_value, rb_hash_each_key, rb_hash_each_pair,
env_each_key, env_each_value, env_each, env_each_pair,
env_reject_bang, env_delete_if, env_select): Ditto.
* numeric.c (num_step, int_upto, int_downto, int_dotimes): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-14 08:57:23 +00:00
nobu
163b436fad
* numeric.c (fix_coerce): try conversion before type check.
...
[ruby-core:15838]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-11 10:48:12 +00:00
akr
89dac0bc8c
* numeric.c (int_odd_p): new method Integer#odd?.
...
(int_even_p): new method Integer#even?.
(int_pred): new method Integer#pred.
(fix_odd_p): new method Fixnum#odd?.
(fix_even_p): new method Fixnum#even?.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-05 09:12:58 +00:00
nobu
349377aab4
* numeric.c (round): fallback definition.
...
* numeric.c (flo_divmod, flo_round): use round() always.
[ruby-dev:32269]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-13 16:34:45 +00:00
nobu
4e0ac23588
* numeric.c (flodivmod): work around for inifinity.
...
* numeric.c (flo_divmod): work around for platforms have no round().
[ruby-dev:32247]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-13 07:33:09 +00:00
akr
6bc16a1198
* numeric.c (numeric.c): Integer#ord implemented. [ruby-dev:32206]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-13 05:00:03 +00:00
shyouhei
9bb7c21970
* numeric.c (flo_divmod): round to the nearest integer. [ ruby-Bugs-14540 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-11-12 18:41:31 +00:00
nobu
93f00244c5
* numeric.c (fix_pow): returns 1.0 for 0**0.0.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-26 08:14:14 +00:00
nobu
92d83c9354
* numeric.c (fix_pow): returns infinity for 0**-1. [ruby-dev:32084]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-26 08:01:41 +00:00
nobu
9bf8a37572
* bignum.c (rb_big_lshift, rb_big_rshift): separated functions
...
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/branches/ruby_1_8@12814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-19 05:38:48 +00:00
matz
217db90e87
* numeric.c (fix_pow): integer power calculation: 0**n => 0,
...
1**n => 1, -1**n => 1 (n: even) / -1 (n: odd).
* test/ruby/test_fixnum.rb (TestFixnum::test_pow): update test
suite. pow(-3, 2^64) gives NaN when pow(3, 2^64) gives Inf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-16 15:56:16 +00:00
matz
bd3af05e48
* numeric.c (fix_pow): 0**2 should not raise floating point
...
exception. [ruby-dev:31216]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 17:53:10 +00:00
matz
98b7080d2a
* numeric.c (int_pow): wrong overflow detection. [ruby-dev:31215]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 17:27:40 +00:00
matz
356d61050c
* numeric.c (int_pow): wrong overflow detection. [ruby-dev:31213]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-13 16:46:39 +00:00
usa
42b4e02760
* numeric.c (int_pow): fix previous nubu's commit.
...
* test/ruby/test_fixnum.rb: new test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12699 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 07:45:02 +00:00
nobu
890d25d46f
* numeric.c (int_pow): even number multiplication never be negative.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-05 06:56:10 +00:00
nobu
ce6fd792ad
* numeric.c: purged trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-09 04:11:41 +00:00
nobu
8624d6b3f6
* bignum.c (Init_Bignum), numeric.c (Init_Numeric): added fdiv as
...
aliases of quo. [ruby-dev:30771]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-09 03:28:08 +00:00
nobu
587035c080
* numeric.c (int_pow): calculate power in Fixnum as possible.
...
[ruby-dev:30726]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-05-09 03:16:16 +00:00
knu
38c8efbe2d
* numeric.c (fix_cmp, fix_equal): Remove FIX2LONG() to optimize.
...
suggested in
http://t-a-w.blogspot.com/2007/02/making-ruby-faster.html .
[ruby-talk:240223]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-23 04:04:14 +00:00
ryan
c2f9106b1a
Minor rdoc fix
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-24 20:47:57 +00:00
matz
b2b33db355
* numeric.c (fix_plus): addition in Fixnum will never overflow
...
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/branches/ruby_1_8@10880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-07 16:35:59 +00:00
nobu
dfac39ff8d
* numeric.c (flo_hash): improve collision. fixed: [ruby-dev:29352]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-04 20:57:02 +00:00
akr
53cec657a1
* common.mk, configure.in, defines.h, eval.c, gc.c, main.c,
...
numeric.c, ruby.h, ia64.s: backport IA64 HP-UX support.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10827 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-01 18:47:11 +00:00
matz
9466848db3
* numeric.c (num_div): use floor rather than rb_Integer().
...
[ruby-dev:28589]
* numeric.c (flo_divmod): the first element of Float#divmod should
be an integer. [ruby-dev:28589]
* test/ruby/test_float.rb: add tests for divmod, div, modulo and remainder.
* util.c (ruby_strtod): fixed wrong conversion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-05-01 03:46:47 +00:00
ocean
dbf7e59c68
* numeric.c (fix_to_s): removed workaround for radix 2. Historically,
...
rb_fix2str can only handle radix 8, 10, 16. (Rev1.37) But for now,
it can handle radix 2..36. [ruby-Bugs#3438]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-05 12:09:31 +00:00
ocean
1939b48f8d
* numeric.c (fix_to_s): (2**32).to_s(2) fails with exception where
...
sizeof(int) == 4 < sizeof(long). [ruby-core:7300]
I think the function name of rb_int2big is quite misleading.
This should be "rb_long2big".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-04 06:58:43 +00:00
matz
2c0701f658
* ext/readline/readline.c (readline_readline): type check.
...
[ruby-core:6089]
* numeric.c (fix_rshift): RDoc fix. [ruby-core:6351]
* util.h (strtod): add #undef for platforms defines strtod()
macro. [ruby-dev:27563]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-10-30 18:20:54 +00:00
nobu
e594bf57d8
* class.c (rb_mod_init_copy, rb_class_init_copy), file.c (rb_stat_init_copy),
...
numeric.c (num_init_copy), object.c (rb_obj_init_copy, Init_Object),
re.c (match_init_copy, rb_reg_init_copy), time.c (time_init_copy):
undocumented.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-28 14:42:46 +00:00
matz
210bf4dc6e
* bignum.c (rb_big_eq): reduce isnan(). [ruby-dev:26600]
...
* numeric.c (flo_eq, flo_gt, flo_ge, flo_lt, flo_le): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-07-22 13:04:25 +00:00
matz
c33063f42d
* numeric.c (fix_pow): support Fixnum ** Float case directly
...
without coercing. [ruby-talk:142697] [ruby-talk:143054]
* ruby.c (require_libraries): caused SEGV when continuation jumped
in to the required library code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-24 14:52:05 +00:00
ocean
c3af8e7c3b
* numeric.c (flo_plus): small typo fix. [ruby-core:4636]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-05-10 01:40:49 +00:00
matz
88d5dcc8de
* exception error messages updated. [ruby-core:04497]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-28 02:45:23 +00:00
ocean
cfa20a2a86
* numeric.c (Init_Numeric): turn off floating point exceptions
...
on bcc32. "1e300".to_f had crashed by overflow.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-01-11 00:46:35 +00:00
matz
db8a49614f
* process.c (proc_getpgrp): prohibit for $SAFE=2.
...
[ruby-dev:24899]
* process.c (get_pid): ditto. [ruby-dev:24904]
* process.c (get_ppid): ditto.
* array.c (rb_ary_delete): defer rb_ary_modify() until actual
modification. [ruby-dev:24901]
* parse.y (newline_node): should not use FL_SET. [ruby-dev:24874]
* parse.y (string_content): should not use FL_UNSET.
* node.h (NODE_NEWLINE): remove unused bit to utilize flag field
in nodes.
* string.c (rb_str_splice): move rb_str_modify() after
StringValue(), which may alter the receiver. [ruby-dev:24878]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-18 03:47:14 +00:00
matz
73deb73392
* numeric.c (flo_divmod): protect float values from GC by
...
assignment to local variables. [ruby-dev:24873]
* string.c (str_mod_check): frozen check should be separated.
[ruby-core:3742]
* array.c (rb_ary_update): pedantic check to detect
rb_ary_to_ary() to modify the receiver. [ruby-dev:24861]
* string.c (rb_str_justify): typo fixed. [ruby-dev:24851]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-11-16 14:54:49 +00:00
matz
ece87af00c
* string.c (RESIZE_CAPA): check string attribute before modifying
...
capacity member of string structure. [ruby-dev:24594]
* ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
performance. [ruby-talk:117701]
* sprintf.c (rb_f_sprintf): raise ArgumentError for extra
arguments, unless (digit)$ style used.
* ext/zlib/zlib.c (gzreader_gets): use memchr() to to gain
performance. [ruby-talk:117701]
* sprintf.c (rb_f_sprintf): raise ArgumentError for extra
arguments, unless (digit)$ style used.
* eval.c (frame_free): Guy Decoux solved the leak problem.
Thanks. [ruby-core:03549]
* ext/zlib/zlib.c (zstream_append_input): clear klass for z->input
to avoid potential vulnerability.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-10-27 02:46:54 +00:00
ocean
703f913426
* array.c, enum.c, pack.c: rdoc patch from Johan Holmberg
...
<holmberg@iar.se> [ruby-core:3132] [ruby-core:3136]
* numeric.c: rdoc patch.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-07-09 13:38:34 +00:00
matz
36eb460780
* eval.c (rb_mod_freeze): prepare string representation before
...
freezing. [ruby-talk:103646]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-16 14:21:34 +00:00
matz
79c7044582
* io.c (rb_io_gets_m): set lastline ($_) even when read line is
...
nil. [ruby-dev:23663]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-06-04 09:56:25 +00:00