This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
I never thought we could compare (>,<,== ,!=) an int with a double or double with long or long with float etc.
I thought the primitives should be of the same type for comparison.
Can someone throw some light on this......
posted 11 years ago
There are conversions that take place during the evaluation of the expression. "Widening", etc. The language specification talks about it in detail. But simply put, most things will be "widened" to the greater number of bits required and then the evaluation will take place.