Strange behaviour of the Array type with `==` operator

Because the definition of “equals” for Arrays is that they refer to the same array. This is consistent with Java’s array equality, using Object.Equals, so it compares references. If you want to check pairwise elements, then use sameElements Array(‘a’,’b’).sameElements(Array(‘a’,’b’)) or deepEquals, which has been deprecated in 2.8, so instead use: Array(‘a’,’b’).deep.equals(Array(‘a’,’b’).deep) There’s a good Nabble … Read more

c# NaN comparison differences between Equals() and ==

I found an article addressing your question: .NET Security Blog: Why == and the Equals Method Return Different Results for Floating Point Values According to IEC 60559:1989, two floating point numbers with values of NaN are never equal. However, according to the specification for the System.Object::Equals method, it’s desirable to override this method to provide … Read more