Actions
Bug #5736
closedNumeric#quo should convert with #to_r
Description
Numeric#quo currently constructs a Rational with self as the raw numerator, doing no coercion, before dividing. Instead it should follow the same pattern as Numeric#{numerator,denominator}, and convert self with #to_r. This allows any Numeric subclass to participate in the type conversion.
Files
Updated by ko1 (Koichi Sasada) about 13 years ago
- Assignee set to mrkn (Kenta Murata)
Updated by shyouhei (Shyouhei Urabe) about 13 years ago
- Status changed from Open to Assigned
Updated by mrkn (Kenta Murata) almost 12 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r41109.
John, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
-
numeric.c (num_quo): Use to_r method to convert the receiver to
rational. [ruby-core:41575] [Bug #5736] -
test/ruby/test_numeric.rb: add a test for the above change.
Actions
Like0
Like0Like0Like0Like0