The Is Greater Than Comparison Operator checks whether the left value is larger than the right value. This operator evaluates to True if the left value is greater than the right value, and False otherwise. It works with Integer and Float types, but cannot mix different numeric types.
The short syntax structure uses the > symbol:
VALUE > VALUEThe long syntax structure uses the words IS GREATER THAN:
VALUE IS GREATER THAN VALUEPRINTLN 10 > 5 // Displays "TRUE"
PRINTLN 5 > 10 // Displays "FALSE"
PRINTLN 5 > 5 // Displays "FALSE"PRINTLN 5.7 > 2.5 // Displays "TRUE"
PRINTLN 2.0 > 5.0 // Displays "FALSE"
PRINTLN 3.14 > 3.14 // Displays "FALSE"PRINTLN 0 > -5 // Displays "TRUE"
PRINTLN -5 > -10 // Displays "TRUE"
PRINTLN -5 > 0 // Displays "FALSE"NEW INT x = 20
NEW INT y = 10
NEW INT z = 20
PRINTLN x > y // Displays "TRUE"
PRINTLN y > x // Displays "FALSE"
PRINTLN x > z // Displays "FALSE"NEW FLOAT temp1 = 100.0
NEW FLOAT temp2 = 98.6
NEW BOOL isHotter = temp1 > temp2
PRINTLN isHotter // Displays "TRUE"NEW INT age = 25
NEW BOOL isAdult = age > 18
PRINTLN isAdult // Displays "TRUE"The Is Greater Than operator is commonly used in If statements to check numeric thresholds.
NEW INT age = 21
IF age > 18
PRINTLN "Access granted"
ELSE
PRINTLN "Access denied: Must be over 18"
END IF
// Displays "Access granted"NEW FLOAT temperature = 85.0
IF temperature > 90.0
PRINTLN "Very hot"
ELIF temperature > 70.0
PRINTLN "Warm"
ELSE
PRINTLN "Cool or cold"
END IF
// Displays "Warm"NEW INT score = 95
IF score > 90
PRINTLN "Grade: A"
ELIF score > 80
PRINTLN "Grade: B"
ELIF score > 70
PRINTLN "Grade: C"
ELIF score > 60
PRINTLN "Grade: D"
ELSE
PRINTLN "Grade: F"
END IF
// Displays "Grade: A"The Is Greater Than operator is frequently used to control loop iterations.
NEW INT i = 5
WHILE i > 0
PRINTLN "Count: " .. i
SET i = i - 1
END WHILE
// Displays: Count: 5, Count: 4, Count: 3, Count: 2, Count: 1NEW INT value = 20
WHILE value > 10
PRINTLN "Value: " .. value
SET value = value - 2
END WHILE
// Displays: Value: 20, Value: 18, Value: 16, Value: 14, Value: 12NEW INT fuel = 100
WHILE fuel > 0
PRINTLN "Fuel remaining: " .. fuel
SET fuel = fuel - 25
END WHILE
PRINTLN "Out of fuel"NEW INT x = 10
NEW INT y = 5
NEW BOOL result = ( x + y ) > 10
PRINTLN result // Displays "TRUE" ( 15 > 10 )NEW INT width = 5
NEW INT height = 6
NEW BOOL isLarge = ( width * height ) > 25
PRINTLN isLarge // Displays "TRUE" ( 30 > 25 )NEW INT a = 5
NEW INT b = 3
NEW INT c = 2
NEW BOOL comparison = ( a + b ) > ( c * 3 )
PRINTLN comparison // Displays "TRUE" ( 8 > 6 )NEW INT value = 15
NEW BOOL outOfRange = ( value > 20 ) || ( value > 50 )
PRINTLN outOfRange // Displays "FALSE"NEW INT score = 85
NEW BOOL isPassing = ( score > 60 ) && ( score > 50 )
PRINTLN isPassing // Displays "TRUE"NEW INT age = 25
NEW BOOL hasExperience = TRUE
NEW BOOL isQualified = ( age > 21 ) && hasExperience
PRINTLN isQualified // Displays "TRUE"NEW INT hoursWorked = 45
NEW INT regularHours = 40
IF hoursWorked > regularHours
PRINTLN "Overtime pay applies"
ELSE
PRINTLN "Regular pay only"
END IF
// Displays "Overtime pay applies"NEW INT currentScore = 1500
NEW INT highScore = 1000
IF currentScore > highScore
PRINTLN "New high score!"
ELSE
PRINTLN "Keep trying"
END IF
// Displays "New high score!"NEW INT a = 25
NEW INT b = 18
NEW INT maximum = 0
IF a > b
SET maximum = a
ELSE
SET maximum = b
END IF
PRINTLN "Maximum value: " .. maximum
// Displays "Maximum value: 25"NEW FLOAT temperature = 105.0
NEW FLOAT dangerThreshold = 100.0
IF temperature > dangerThreshold
PRINTLN "WARNING: Temperature exceeds safe limit!"
ELSE
PRINTLN "Temperature within normal range"
END IF
// Displays "WARNING: Temperature exceeds safe limit!"NEW INT x = 10
NEW INT y = 10
PRINTLN x > y // Displays "FALSE" ( 10 is not greater than 10 )NEW INT score = 90
// Wrong for inclusive threshold
IF score > 90
PRINTLN "Above threshold"
END IF
// Correct for inclusive threshold
IF score >= 90
PRINTLN "At or above threshold"
END IF
// Displays "At or above threshold"Is Greater Than checks if the left value is larger, while Is Less Than checks if the left value is smaller.
NEW INT x = 15
NEW INT y = 10
PRINTLN x > y // Displays "TRUE"
PRINTLN x < y // Displays "FALSE"
PRINTLN y > x // Displays "FALSE"
PRINTLN y < x // Displays "TRUE"NEW INT credits = 125
NEW INT requiredCredits = 120
IF credits > requiredCredits
PRINTLN "Eligible for graduation"
ELSE
PRINTLN "Need more credits"
END IF
// Displays "Eligible for graduation"NEW INT speed = 75
NEW INT speedLimit = 65
IF speed > speedLimit
PRINTLN "Speeding! Slow down."
ELSE
PRINTLN "Speed is acceptable"
END IF
// Displays "Speeding! Slow down."NEW INT taskPriority = 8
NEW INT highPriorityThreshold = 7
IF taskPriority > highPriorityThreshold
PRINTLN "High priority task - process immediately"
ELSE
PRINTLN "Normal priority task"
END IF
// Displays "High priority task - process immediately"NEW FLOAT pressure = 45.5
NEW FLOAT maxPressure = 40.0
IF pressure > maxPressure
PRINTLN "Pressure relief valve activated"
ELSE
PRINTLN "Pressure normal"
END IF
// Displays "Pressure relief valve activated"NEW INT i = 1
WHILE i <= 10
IF i > 5
PRINTLN "Value above threshold: " .. i
END IF
SET i = i + 1
END WHILE
// Displays values 6 through 10NEW INT value = 1
NEW INT target = 50
WHILE value <= 100
IF value > target
PRINTLN "First value above target: " .. value
BREAK
END IF
SET value = value + 10
END WHILENEW INT x = 10
NEW FLOAT y = 5.0
PRINTLN x > y // Type error! Cannot mix Integer and FloatNEW STR name1 = "Bob"
NEW STR name2 = "Alice"
PRINTLN name1 > name2 // Type error! Cannot compare Strings with >NEW BOOL a = TRUE
NEW BOOL b = FALSE
PRINTLN a > b // Type error! Cannot compare Booleans with >NEW INT points = 100
IF points > 100 // FALSE when points is exactly 100
PRINTLN "Over 100 points"
END IF
// Use >= for inclusive check
IF points >= 100
PRINTLN "100 points or more"
END IF
// Displays "100 points or more"