Backport #5319
closedProblem backporting [ruby-dev:38672] to 1.8.7p334
Description
It appears that the change in [ruby-dev:38672] was not backported correctly to 1.8.7p334
comparison.rb¶
inf = 1.0/0.0
b = Float::MAX.to_i * 2
p(inf <=> b) # => should be 1
p(b <=> inf) # => should be -1
p(inf <=> (-b)) # => should be 1
p((-b) <=> inf) # => should be -1
p((-inf) <=> b) # should be -1
p(b <=> (-inf)) # should be 1
p((-inf) <=> (-b)) # should be -1
p((-b) <=> (-inf)) # should be 1
$ ruby1.9.2 -v comparison.rb
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
1
-1
1
-1
-1
1
-1
1
$ ruby1.8.7 -v comparison.rb
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.8.0]
comparison.rb:4: warning: Bignum out of Float range
0
comparison.rb:5: warning: Bignum out of Float range
0
comparison.rb:7: warning: Bignum out of Float range
0
comparison.rb:8: warning: Bignum out of Float range
0
comparison.rb:10: warning: Bignum out of Float range
-1
comparison.rb:11: warning: Bignum out of Float range
1
comparison.rb:13: warning: Bignum out of Float range
-1
comparison.rb:14: warning: Bignum out of Float range
1
Thanks,
Brian
Updated by brixen (Brian Shirai) about 13 years ago
On Tue, Sep 13, 2011 at 2:02 PM, Brian Ford brixen@gmail.com wrote:
Issue [ruby-dev:38672] to 1.8.7p334 (Closed)" href="/issues/5319">#5319 has been reported by Brian Ford.
Backport [ruby-dev:38672] to 1.8.7p334 (Closed)" href="/issues/5319">#5319: Problem backporting [ruby-dev:38672] to 1.8.7p334
http://redmine.ruby-lang.org/issues/5319Author: Brian Ford
Status: Open
Priority: Normal
Assignee:
Category:
Target version: Ruby 1.8.7It appears that the change in [ruby-dev:38672] was not backported correctly to 1.8.7p334
This is also not corrected in p352.
Brian
comparison.rb¶
inf = 1.0/0.0
b = Float::MAX.to_i * 2p(inf <=> b) # => should be 1
p(b <=> inf) # => should be -1p(inf <=> (-b)) # => should be 1
p((-b) <=> inf) # => should be -1p((-inf) <=> b) # should be -1
p(b <=> (-inf)) # should be 1p((-inf) <=> (-b)) # should be -1
p((-b) <=> (-inf)) # should be 1$ ruby1.9.2 -v comparison.rb
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
1
-1
1
-1
-1
1
-1
1$ ruby1.8.7 -v comparison.rb
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.8.0]
comparison.rb:4: warning: Bignum out of Float range
0
comparison.rb:5: warning: Bignum out of Float range
0
comparison.rb:7: warning: Bignum out of Float range
0
comparison.rb:8: warning: Bignum out of Float range
0
comparison.rb:10: warning: Bignum out of Float range
-1
comparison.rb:11: warning: Bignum out of Float range
1
comparison.rb:13: warning: Bignum out of Float range
-1
comparison.rb:14: warning: Bignum out of Float range
1Thanks,
Brian
Updated by shyouhei (Shyouhei Urabe) about 13 years ago
- Project changed from Ruby 1.8 to Backport187
- Status changed from Open to Assigned
- Assignee set to shyouhei (Shyouhei Urabe)
- Target version deleted (
Ruby 1.8.7)
Hmm. Thank you reporting. I'll take a look.
Updated by shyouhei (Shyouhei Urabe) about 13 years ago
- % Done changed from 0 to 50
Updated by shyouhei (Shyouhei Urabe) almost 8 years ago
- Status changed from Assigned to Closed