Forum: Ruby-core [ruby-trunk - Bug #6677][Open] Bignum#== and Float#== should be symmetric

Posted by Eregon (Benoit Daloze) (Guest)
on 2012-06-30 16:27
(Received via mailing list)
Issue #6677 has been reported by Eregon (Benoit Daloze).

----------------------------------------
Bug #6677: Bignum#== and Float#== should be symmetric
https://bugs.ruby-lang.org/issues/6677

Author: Eregon (Benoit Daloze)
Status: Open
Priority: Normal
Assignee:
Category: core
Target version:
ruby -v: ruby 2.0.0dev (2012-05-25 trunk 35779) [x86_64-darwin10.8.0]


Reading #3429 again, I noticed a related bug (and by the way, thank you 
nobu for solving that bug!):

I wrote:
"Also, while doing some tests about this I noticed that "bignum == 
Float::INFINITY" [...], while it should not, as it is always false."

I did not notice it to hang anymore, but the result of #== is 
asymmetrical:

    irb for ruby 2.0.0 r35779
    > n=2**7830457;nil
    => nil
    > n == Float::INFINITY
    => false
    > Float::INFINITY == n
    => true

I think a Bignum is never infinite.
Posted by mrkn (Kenta Murata) (Guest)
on 2012-07-01 09:40
(Received via mailing list)
Issue #6677 has been updated by mrkn (Kenta Murata).

Assignee set to mrkn (Kenta Murata)


----------------------------------------
Bug #6677: Bignum#== and Float#== should be symmetric
https://bugs.ruby-lang.org/issues/6677#change-27654

Author: Eregon (Benoit Daloze)
Status: Open
Priority: Normal
Assignee: mrkn (Kenta Murata)
Category: core
Target version:
ruby -v: ruby 2.0.0dev (2012-05-25 trunk 35779) [x86_64-darwin10.8.0]


Reading #3429 again, I noticed a related bug (and by the way, thank you 
nobu for solving that bug!):

I wrote:
"Also, while doing some tests about this I noticed that "bignum == 
Float::INFINITY" [...], while it should not, as it is always false."

I did not notice it to hang anymore, but the result of #== is 
asymmetrical:

    irb for ruby 2.0.0 r35779
    > n=2**7830457;nil
    => nil
    > n == Float::INFINITY
    => false
    > Float::INFINITY == n
    => true

I think a Bignum is never infinite.
Posted by mame (Yusuke Endoh) (Guest)
on 2012-07-14 11:45
(Received via mailing list)
Issue #6677 has been updated by mame (Yusuke Endoh).

Status changed from Open to Assigned


----------------------------------------
Bug #6677: Bignum#== and Float#== should be symmetric
https://bugs.ruby-lang.org/issues/6677#change-28099

Author: Eregon (Benoit Daloze)
Status: Assigned
Priority: Normal
Assignee: mrkn (Kenta Murata)
Category: core
Target version:
ruby -v: ruby 2.0.0dev (2012-05-25 trunk 35779) [x86_64-darwin10.8.0]


Reading #3429 again, I noticed a related bug (and by the way, thank you 
nobu for solving that bug!):

I wrote:
"Also, while doing some tests about this I noticed that "bignum == 
Float::INFINITY" [...], while it should not, as it is always false."

I did not notice it to hang anymore, but the result of #== is 
asymmetrical:

    irb for ruby 2.0.0 r35779
    > n=2**7830457;nil
    => nil
    > n == Float::INFINITY
    => false
    > Float::INFINITY == n
    => true

I think a Bignum is never infinite.
Posted by marcandre (Marc-Andre Lafortune) (Guest)
on 2013-01-25 06:56
(Received via mailing list)
Issue #6677 has been updated by marcandre (Marc-Andre Lafortune).

Status changed from Assigned to Closed

Fixed as of r38825.
----------------------------------------
Bug #6677: Bignum#== and Float#== should be symmetric
https://bugs.ruby-lang.org/issues/6677#change-35623

Author: Eregon (Benoit Daloze)
Status: Closed
Priority: Normal
Assignee: mrkn (Kenta Murata)
Category: core
Target version:
ruby -v: ruby 2.0.0dev (2012-05-25 trunk 35779) [x86_64-darwin10.8.0]


Reading #3429 again, I noticed a related bug (and by the way, thank you 
nobu for solving that bug!):

I wrote:
"Also, while doing some tests about this I noticed that "bignum == 
Float::INFINITY" [...], while it should not, as it is always false."

I did not notice it to hang anymore, but the result of #== is 
asymmetrical:

    irb for ruby 2.0.0 r35779
    > n=2**7830457;nil
    => nil
    > n == Float::INFINITY
    => false
    > Float::INFINITY == n
    => true

I think a Bignum is never infinite.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.