comparison operators: basic question

is this kind of operation valid?

if (x <= (0-y)){
do something...
}

is it the same like

if (x <= -y){
do something...
}

What type of variable is y ?

It matters

The greater question that needs an answer is, do you not have a C/C++ test bed on your computer where you can simply enter code and test it without downloading to the Arduino? If the answer to that question is no, the next question is, why not?

I just did some tests and it seems that the results are the same regardless of being signed or unsigned.

is this kind of operation valid?

Yes.

is it the same like

Not necessarily. See this thread.

DKWatson:
I just did some tests and it seems that the results are the same regardless of being signed or unsigned.

What happens if x is declared as a byte ?