Commit 7a607112 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1791 from iij/pr-numeric-div

add Integer#div and Float#div to mruby-numeric-ext
parents 6b6277e2 4ad0896b
module Integral
def div(other)
self.divmod(other)[0]
end
end
......@@ -13,3 +13,11 @@ assert('Integer#chr') do
assert_raise(RangeError) { 256.chr }
end
end
assert('Integer#div') do
assert_equal 52, 365.div(7)
end
assert('Float#div') do
assert_float 52, 365.2425.div(7)
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment