Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我应该如何将这些 if 语句更改为 IP 约束?
If x-y>=0 then z=0 if x-y<0 then z=1
假设类似于 C (98) 的语言,其中布尔表达式产生 0 或 1:
z = x-y<0
z将是一个布尔值,如果 ,则为真x-y <0,但评估实际上是true=1, false=0- 它会让你得到你想要的。
z
x-y <0
true=1
false=0