Bug #5736 ยป 0001-numeric.c-num_quo-Convert-to-Rational-using-to_r.patch
| ChangeLog | ||
|---|---|---|
|
Fri Dec 9 13:04:44 2011 John Firebaugh <john.firebaugh@gmail.com>
|
||
|
* numeric.c (num_quo): Convert to Rational using #to_r.
|
||
|
Fri Dec 9 19:24:31 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||
|
* enc/trans/iso-8859-16-tbl.rb: add ISO-8859-16 converter.
|
||
| numeric.c | ||
|---|---|---|
|
static VALUE fix_mul(VALUE x, VALUE y);
|
||
|
static VALUE int_pow(long x, unsigned long y);
|
||
|
static ID id_coerce, id_to_i, id_eq;
|
||
|
static ID id_coerce, id_to_i, id_to_r, id_eq;
|
||
|
VALUE rb_cNumeric;
|
||
|
VALUE rb_cFloat;
|
||
| ... | ... | |
|
static VALUE
|
||
|
num_quo(VALUE x, VALUE y)
|
||
|
{
|
||
|
return rb_funcall(rb_rational_raw1(x), '/', 1, y);
|
||
|
return rb_funcall(rb_funcall(x, id_to_r, 0), '/', 1, y);
|
||
|
}
|
||
| ... | ... | |
|
#endif
|
||
|
id_coerce = rb_intern("coerce");
|
||
|
id_to_i = rb_intern("to_i");
|
||
|
id_to_r = rb_intern("to_r");
|
||
|
id_eq = rb_intern("==");
|
||
|
rb_eZeroDivError = rb_define_class("ZeroDivisionError", rb_eStandardError);
|
||