Backport #8914

r42942

Added by tadayoshi funaba 7 months ago. Updated 3 months ago.

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

Description

r42942 同様にする。

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

History

#1 Updated by Tomoyuki Chikanaga 7 months ago

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

#2 Updated by Tomoyuki Chikanaga 3 months 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#testquo in testbignum.rb become failure with it.

backport patch:

--- rational.c (revision 44793)
+++ rational.c (working copy)
@@ -903,16 +903,6 @@
other, ONE, '/');
}
case TFLOAT:
- {
- double x = RFLOAT
VALUE(other), den;
- getdat1(self);
-
- if (isnan(x)) return DBL2NUM(NAN);
- if (isinf(x)) return INT2FIX(0);
- if (x != 0.0 && modf(x, &den) == 0.0) {
- return rb
rationalraw2(dat->num, fmul(rbdbl2big(den), dat->den));
- }
- }
return rb
funcall(ftof(self), '/', 1, other);
case TRATIONAL:
if (f
zero_p(other))

failed test

TestBignum#testquo = 0.00 s
1) Failure:
test
quo(TestBignum) [/Users/nagachika/opt/ruby-2.0.0/src/ruby200/test/ruby/testbignum.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