Math.sin( 0.5 ) >= Math.tan( 0.2 ) || 43.259 / 12.073 > 3.5 || ( 100 < 45 )
There are no side-effects here, so it is safe to look at the last part:
( 100 < 45 )
and realize that the entire expression will be false
.
Java (working from left to right) might have found a different false
,
but in the absence of side-effects that doesn't matter.
The entire expression is false
.
Math functions, such as Math.sin()
and Math.cos()
,
do not have side effects.
They are safe to use in boolean expressions.
Say that you have not yet given up on buying that $25,000 red Miata sports car. The sales manager of the car lot will let you buy the car if:
The logic of this situation is slightly complicated. Here are several situations:
Notice that it is not enough to merely have a high credit line. To buy the car on credit you must also be free of debt.