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
+
1
7
Wed Jun 6 14:06:02 2012 Tanaka Akira <akr@fsij.org>
2
8
3
9
* lib/webrick/utils.rb: fix fcntl call.
@@ -21,15 +27,6 @@ Sat Apr 14 18:51:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
21
27
GC. [exerb-dev:0578]. patched by MURASE Masamitsu
22
28
<masamitsu.murase AT gmail.com> at [exerb-dev:0580]
23
29
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
-
33
30
Fri Mar 2 11:44:33 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
34
31
35
32
* 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)
1069
1069
1070
1070
if (isinf (d )) {
1071
1071
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 ;
1073
1076
}
1074
1077
return d ;
1075
1078
}
Original file line number Diff line number Diff line change @@ -103,4 +103,10 @@ def test_too_big_to_s
103
103
e = assert_raise ( RangeError ) { ( 1 << big ) . to_s }
104
104
assert_match ( /too big to convert/ , e . message )
105
105
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
106
112
end
Original file line number Diff line number Diff line change 2
2
#define RUBY_RELEASE_DATE "2012-06-06"
3
3
#define RUBY_VERSION_CODE 187
4
4
#define RUBY_RELEASE_CODE 20120606
5
- #define RUBY_PATCHLEVEL 364
5
+ #define RUBY_PATCHLEVEL 365
6
6
7
7
#define RUBY_VERSION_MAJOR 1
8
8
#define RUBY_VERSION_MINOR 8
You can’t perform that action at this time.
0 commit comments