summaryrefslogtreecommitdiff
path: root/sample/test.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-23 07:05:59 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-06-23 07:05:59 +0000
commit552fb72159d3bb27ff40ecc121bbc52a3fff89a1 (patch)
treed6abf2514a01ce6f2ff5160cea2d132933af3973 /sample/test.rb
parent44cf56d6e70dbe06a160b004494ba40dd4cfb426 (diff)
2000-06-23
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample/test.rb')
-rw-r--r--sample/test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 8f789fd..9da67f5 100644
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -607,6 +607,17 @@ for i in 4000..4096
end
ok($good)
+b = 10**80
+a = b * 9 + 7
+ok(7 == a % b)
+ok(7-b == a % (-b))
+ok(b-7 == (-a) % b)
+ok(-7 ==(-a) % (-b))
+ok(7 ==a.remainder(b))
+ok(7 ==a.remainder(-b))
+ok(-7 == (-a).remainder(b))
+ok(-7 == (-a).remainder(-b))
+
check "string & char"
ok("abcd" == "abcd")