Backport #8914

r42942

Added by tadayoshi funaba over 1 year ago. Updated about 1 year ago.

[ruby-dev:47712]
Status:Assigned
Priority:Normal
Assignee:Tomoyuki Chikanaga

Description

r42942 同様にする。

r28844, r28886, r28887 などの意味不明な修正を無効化する。

History

#1 Updated by Tomoyuki Chikanaga over 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Tomoyuki Chikanaga

#2 Updated by Tomoyuki Chikanaga about 1 year ago

  • Priority changed from High to Normal
  • ruby -v set to 2.0.0p353

Hello,

I'd like to backport a patch shown below, but TestBignum#test_quo in test_bignum.rb become failure with it.

backport patch:

--- rational.c (revision 44793)
+++ rational.c (working copy)
@@ -903,16 +903,6 @@
other, ONE, '/');
}
case T_FLOAT:
- {
- double x = RFLOAT_VALUE(other), den;
- get_dat1(self);
-
- if (isnan(x)) return DBL2NUM(NAN);
- if (isinf(x)) return INT2FIX(0);
- if (x != 0.0 && modf(x, &den) == 0.0) {
- return rb_rational_raw2(dat->num, f_mul(rb_dbl2big(den), dat->den));
- }
- }
return rb_funcall(f_to_f(self), '/', 1, other);
case T_RATIONAL:
if (f_zero_p(other))

failed test

TestBignum#test_quo = 0.00 s
1) Failure:
test_quo(TestBignum) [/Users/nagachika/opt/ruby-2.0.0/src/ruby_2_0_0/test/ruby/test_bignum.rb:423]:
expected but was
.

I know that TestBignum#test_quo was modified at r41099 in trunk ([Bug #5515]), but it contains behavior change. Even though current behavior is buggy, there can be program depend on that bug. I postpone to backport this. I'll reconsider if another request with actual case come.

Also available in: Atom PDF