Negation (complement) of Less-than, Greater-than etc
What is the negation (complement) of:
i < A.Length
in the context of:
Do (i < A.Length ) // is it i == A.Length or i > A.Length ?
What is the negation of
i <= A.Length
in the context of:
Do (i <= A.开发者_StackOverflow社区Length ) // is it i >= A.Length ?
For some reason I can't find a source to confirm.
Try just to draw a line with 0 in the middle. Then, all that is to right of zero is > 0
, so the complement is another part of the line. And it is < 0
and 0
. So, the complement to > 0
is <= 0
.
The complement of < is >= and the complement of > is <= though without understanding what i is, relative to the .length properties, that operation may not be quite what you want.
Negation of i < A.Length
is i >= A.Length
and negation of i <= A.Length
is i > A.Length
.
精彩评论