From 6987b0806e970c7e4b19800c2a2effc290947b78 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 18 Apr 2003 18:05:11 +0000 Subject: * struct.c (rb_struct_eql): should compare values with "eql?". * range.c (range_check): <=> returns nil for invalid values; should check. * regex.c (re_compile_pattern): should not set RE_OPTIMIZE_ANCHOR, if anychar_repeat is enclosed by parentheses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- sample/test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sample') diff --git a/sample/test.rb b/sample/test.rb index 0abf999e39..ebed593960 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -995,6 +995,9 @@ nan.test(-0.001); nan.test(1.0/0); nan.test(-1.0/0); +s = "3.7517675036461267e+17" +test_ok(s == sprintf("%.16e", s.to_f)) + test_check "bignum" def fact(n) return 1 if n == 0 @@ -1550,6 +1553,13 @@ test_ok($x == Marshal.load($y)) StrClone=String.clone; test_ok(Marshal.load(Marshal.dump(StrClone.new("abc"))).class == StrClone) +[[1,2,3,4], [81, 2, 118, 3146]].each { |w,x,y,z| + a = (x.to_f + y.to_f / z.to_f) * Math.exp(w.to_f / (x.to_f + y.to_f / z.to_f)) + ma = Marshal.dump(a) + b = Marshal.load(ma) + test_ok(a == b) +} + test_check "pack" $format = "c2x5CCxsdils_l_a6"; -- cgit v1.2.3