且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

“!= true"之间的区别和"== false"?

更新时间: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.