Project

General

Profile

Actions

Bug #19343

closed

Integer#ceildiv should respect #coerce

Added by kyanagi (Kouhei Yanagita) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21]
[ruby-core:111816]

Description

https://github.com/ruby/ruby/pull/7118

This issue is similar to #19335.

c = Object.new
def c.coerce(other) = [other, 10]

p 1234 / c          # => 123
p 1234.div(c)       # => 123
p 1234.quo(c)       # => (617/5)
p 1234.fdiv(c)      # => 123.4
p 1234.ceildiv(c)   # => in `ceildiv': undefined method `-@' for #<Object:0x000000010250ad68> (NoMethodError)
Actions

Also available in: Atom PDF

Like0
Like0Like0