This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
In this case, the long value will be promoted to a double value before the equality expression is evaluated. Thus, the values are deemed to be equal. The widening rules are as follows:
1. If either expression is of type double, the other is converted to a double 2. If either expression is of type float, the other is converted to a float 3. If either exprssion is of type long, the other is converted to a long 4. Otherwise, both operands are converted to int