Reputation: 179
I am working on a home assignment and I don't understand one thing about it.. Maybe some of you guys can help me with that.
(a < 0) ? 1 : -1
What does this mean?
Upvotes: 1
Views: 39
Reputation: 3066
This is basically saying is the variable a less then 0? if it is 1 if it is not then -1 it is like this
if(a<0)
1
else
-1
Upvotes: 1