

WTF Java? Why Not Overload == for Java.lang.Long? - javinpaul
http://stackoverflow.com/questions/20541636/compare-non-primitive-data-type-long-values-in-java

======
jeorgun
This particular quirk also holds true of, say, Ruby or Python:

    
    
        256 is 256         # True
        (2**50) is (2**50) # False
    

albeit without Java's fear of operator overloading and the
counterintuitiveness it causes.

~~~
dkannan
Comparison works as expected in Ruby Have checked in ruby 2.1.2p95

code:

> (2 __50).class #= > Fixnum > (2 __50) == (2 __50) #= > true > (2
> __100).class #= > Bignum > (2 __100) == (2 __100) #= > true

~~~
jeorgun
Comparisons work, but Ruby's == isn't the same as Java's; what I was referring
to was

    
    
        250.object_id == 250.object_id         # true
        (2**70).object_id == (2**70).object_id # false

