summaryrefslogtreecommitdiff
path: root/numeric.rb
diff options
context:
space:
mode:
authorKouhei Yanagita <yanagi@shakenbu.org>2023-01-22 18:53:02 +0900
committerGitHub <noreply@github.com>2023-01-22 18:53:02 +0900
commit20a85ab6119964d1ff129f9c6676fa2a7b2a2be4 (patch)
treea484952f92a62b17e1666639cbf1680d0afe4e7f /numeric.rb
parentcad09f7098d11ae32e5c10fa3726399621b4f8bd (diff)
downloadruby-20a85ab6119964d1ff129f9c6676fa2a7b2a2be4.tar.gz
Fix Integer#ceildiv to respect #coerce (#7118)
Fixes [Bug #19343]
Diffstat (limited to 'numeric.rb')
-rw-r--r--numeric.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/numeric.rb b/numeric.rb
index f026679210..0a1f14865f 100644
--- a/numeric.rb
+++ b/numeric.rb
@@ -278,7 +278,7 @@ class Integer
#
# 3.ceildiv(1.2) # => 3
def ceildiv(other)
- -div(-other)
+ -div(0 - other)
end
#