diff options
Diffstat (limited to 'sample/test.rb')
-rw-r--r-- | sample/test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sample/test.rb b/sample/test.rb index 8f789fdd88..9da67f5722 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") |