14.9 Relational & type-testing operators

The ==, !=, <, >, <=, >=, is and as operators are called the relational and
type-testing operators.
relational-expression:
shift-expression
relational-expression < shift-expression
relational-expression > shift-expression
relational-expression <= shift-expression
relational-expression >= shift-expression
relational-expression is type
relational-expression as type
C# LANGUAGE SPECIFICATION
164
equality-expression:
relational-expression
equality-expression == relational-expression
equality-expression != relational-expression
The is operator is described in ?4.9.9 and the as operator is described in
?4.9.10.
The ==, !=, <, >, <= and >= operators are comparison operators. For an
operation of the form x op y,
where op is a comparison operator, overload resolution (?4.2.4) is applied
to select a specific operator
implementation. The operands are converted to the parameter types of the
selected operator, and the type of
the result is the return type of the operator.
The predefined comparison operators are described in the following
sections. All predefined comparison
operators return a result of type bool, as described in the following table.

Operation        Result
x == y           true if x is equal to y, false otherwise
x != y           true if x is not equal to y, false otherwise
x < y            true if x is less than y, false otherwise
x > y            true if x is greater than y, false otherwise
x <= y           true if x is less than or equal to y, false otherwise
x >= y           true if x is greater than or equal to y, false otherwise
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值