File tree Expand file tree Collapse file tree 4 files changed +17
-11
lines changed Expand file tree Collapse file tree 4 files changed +17
-11
lines changed Original file line number Diff line number Diff line change 1+ Wed Jun 6 14:44:13 2012 Kenta Murata <mrkn@mrkn.jp>
2+
3+ * bignum.c (rb_big2dbl), test/ruby/test_bignum.rb (test_to_f):
4+ A negative Bignum out of Float range should be converted to -Infinity.
5+ [ruby-core:30492] [Bug #3362]
6+
17Wed Jun 6 14:06:02 2012 Tanaka Akira <akr@fsij.org>
28
39 * lib/webrick/utils.rb: fix fcntl call.
@@ -21,15 +27,6 @@ Sat Apr 14 18:51:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
2127 GC. [exerb-dev:0578]. patched by MURASE Masamitsu
2228 <masamitsu.murase AT gmail.com> at [exerb-dev:0580]
2329
24- Tue Mar 6 12:05:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
25-
26- * lib/yaml/rubytypes.rb (Exception.yaml_new): fix bug that causes
27- YAML serialization problem for Exception.
28- Exception#initialize doesn't use visible instance variable for
29- the exception message, so call the method with the message.
30- patched by Jingwen Owen Ou <jingweno AT gmail.com>.
31- http://github.com/ruby/ruby/pull/41
32-
3330Fri Mar 2 11:44:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
3431
3532 * marshal.c (mark_dump_arg): mark destination string. patch by
Original file line number Diff line number Diff line change @@ -1069,7 +1069,10 @@ rb_big2dbl(x)
10691069
10701070 if (isinf (d )) {
10711071 rb_warn ("Bignum out of Float range" );
1072- d = HUGE_VAL ;
1072+ if (d < 0.0 )
1073+ d = - HUGE_VAL ;
1074+ else
1075+ d = HUGE_VAL ;
10731076 }
10741077 return d ;
10751078}
Original file line number Diff line number Diff line change @@ -103,4 +103,10 @@ def test_too_big_to_s
103103 e = assert_raise ( RangeError ) { ( 1 << big ) . to_s }
104104 assert_match ( /too big to convert/ , e . message )
105105 end
106+
107+ def test_to_f
108+ inf = 1 / 0.0
109+ assert_equal ( inf , ( 1 << 65536 ) . to_f )
110+ assert_equal ( -inf , ( -1 << 65536 ) . to_f ) # [ruby-core:30492] [Bug #3362]
111+ end
106112end
Original file line number Diff line number Diff line change 22#define RUBY_RELEASE_DATE "2012-06-06"
33#define RUBY_VERSION_CODE 187
44#define RUBY_RELEASE_CODE 20120606
5- #define RUBY_PATCHLEVEL 364
5+ #define RUBY_PATCHLEVEL 365
66
77#define RUBY_VERSION_MAJOR 1
88#define RUBY_VERSION_MINOR 8
You can’t perform that action at this time.
0 commit comments