用来对两个表达式进行逻辑蕴涵运算。
语法
result = expression1 Imp expression2
Imp 运算符的语法具有以下几个部分:
| 部分 | 描述 |
| result | 必需的;任何数值变量。 |
| expression1 | 必需的;任何表达式。 |
| expression2 | 必需的;任何表达式。 |
说明
下列表格说明如何确定 result:
| 如果 expression1 为 | 且 expression2 为 | 则 result 为 |
| True | True | True |
| True | False | False |
| True | Null | Null |
| False | True | True |
| False | False | True |
| False | Null | True |
| Null | True | True |
| Null | False | Null |
| Null | Null | Null |
Imp 运算符对两个数值表达式中位置相同的位进行逐位比较,并根据下表对 result 中相应的位进行设置:
| 如果在 expression1 的位为 | 且在 expression2 中的位为 | result 为 | |
| 0 | 0 | 1 | |
| 0 | 1 | 1 | |
| 1 | 0 | 0 | |
| 1 | 1 | 1 | |