Does x! = 0 mean simplify to x> 0?
No, it is not. Because integers are signed.
How to simplify !(x!=0 || y !=0):?
Consider the following rules:
According to 1. this means that
!(x!=0 || y !=0) <=> (!(x!=0)) && (!(y != 0))
By virtue of 2. this means that
(!(x!=0)) && (!(y != 0)) <=> (x == 0) && (y == 0)
<h / "> To check, you can write the following loop:
for(int x = -5; x < 5; x++){
for(int y = -5; y < 5; y++){
if(!(x!=0 || y !=0))
System.out.println("True : ("+x+","+y+")");
}
}
source
share