1

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?

Bathsheba
  • 231,907
  • 34
  • 361
  • 483
drleifz
  • 189
  • 3
  • 12

1 Answers1

1

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
jgr208
  • 2,896
  • 9
  • 36
  • 64