Swift - Greater Than or Equal To

Introduction

To determine whether a number is greater than another number, use the greater than (>) operator:

Demo

print(5 > 5)  //false
print(5 > 6)  //false
print(6 > 5)  //true

Result

You can also use the greater than or equal to (>= ) operator:

Demo

print(7 >= 7) //true
print(7 >= 8) //false
print(9 >= 8) //true

Result

The > and >= operators do not work with the String type.

Related Topic