Reputation: 147
All my searches keep turning up irrelevant answers so I was wondering what is the fundamental problem with the question I am asking:
What is the operator in swift that means NOT Greater than " !> " ? Why doesn't this symbol exist?
edit: Just to clarify: I was trying to make an if statement in Swift where, if the value is not greater than or equal to 0, the value is obviously invalid, but I didn't want to specify a number range. I realized that else would probably catch what I was looking for:
if int >= 1 {
//do something
}else {
//number is not an integer greater than 1
//do something else
}
Upvotes: 4
Views: 6909
Reputation: 1229
How about <=
? If x
is not greater than y
, then x <= y
. There's no need for a "not greater than" operator when it has the same meaning as "less than or equal to."
Upvotes: 12