更新时间:2023-12-04 11:26:52
逻辑上,根据所比较的值的类型和所使用的语言,可能会有差异.例如:
Logically there can be differences depending on the type of value that you are comparing and language you are using. For example:
x == false
表示x != true
,但x != true
并不总是表示x == false
,因为x也可以是一些无意义的值.
x == false
implies x != true
, but x != true
does not always imply x == false
because x can also be some nonsense value.
1 + 1 = 3
都是== false
和!= true
.
7 > cat
都不是== false
和!= true
,因为它是无意义的.
7 > cat
is neither == false
and != true
since it is nonsense.
x = null
是!= true
,但不是== false
.