0
greater than and less than
We can use equal = and not equal != but why we can't use not greater than !> and not less than !< ???
4 Réponses
+ 5
Because those operators aren't defined and you can simply use the inverse or negate the final comparison.
But if you insist try !(a>b) instead of (a<b). They are equal in most respects, except the former is a tiny faction less efficient.
+ 3
The negation of "greater than" (>) is "less than or equal to" (<=), and viceversa.
The negation of "less than" (<) is "greater than or equal to" (>=), and viceversa.
[Python]
print(4>2) # True
print(4<=2) # False
print(4<2) # False
print(4>=2) # True
+ 3
And remember "=" is the assignment operator. "==" means "equals".
+ 2
Not greater than or equal to is equivalent to less than.
Not less than or equal to is equivalent to more than.
And You want to do: if (!(f>=0))... This