How do I check if a number is positive or negative in C#?

前端 未结 17 1457
轻奢々
轻奢々 2020-12-04 05:55

How do I check if a number is positive or negative in C#?

17条回答
  •  [愿得一人]
    2020-12-04 06:23

    Of course no-one's actually given the correct answer,

    num != 0   // num is positive *or* negative!
    

提交回复
热议问题