diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-04-18 18:05:11 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-04-18 18:05:11 +0000 |
| commit | d85c44a7eaeb52d6903431efef004e2b3605a94f (patch) | |
| tree | 79823d81475a9659b3c0e21988721c7d6b200d04 /sample | |
| parent | 6423b6642048a20f4660340efefa67baec4ec1c9 (diff) | |
| download | ruby-d85c44a7eaeb52d6903431efef004e2b3605a94f.tar.gz ruby-d85c44a7eaeb52d6903431efef004e2b3605a94f.tar.xz ruby-d85c44a7eaeb52d6903431efef004e2b3605a94f.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@3695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
| -rw-r--r-- | sample/test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sample/test.rb b/sample/test.rb index 0abf999e3..ebed59396 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"; |
