|| (logical OR)
in
Programming Questions
•
3 years ago
i am using the point2line library to check if a line intersects another.
i thought that "||" worked if any one of the expressions was true?
but the following doesn't seem to work correctly - it seems to only recognise an intersection with the first expression
if ((intersectNorth != null) || (intersectEast != null) || (intersectSouth != null) || (intersectWest != null)) {
do stuff
}
I thought i could write a condition like above and that if any of the conditions are true then an intersection would be recognised.
Am i right or is the above condition (or my understanding of "||") wrong?
thanks
1