GreaterThanSymbol

Greater Than or Equal To in Programming

How every major language writes >= – and the mistakes that trip people up.

The >= operator by language

LanguageGreater thanGreater or equalExample
Python>>=if age >= 18: · chained: 0 <= x < 10
JavaScript / TypeScript>>=if (n >= 0) {…}
Java, C, C++, C#, Go, Rust, Swift, Kotlin>>=while (i >= 0)
SQL>>=WHERE price >= 100 · BETWEEN 10 AND 20 is inclusive
Bash (numbers)-gt-ge[ "$n" -ge 10 ] or (( n >= 10 ))
PowerShell-gt-geif ($n -ge 10)
R, MATLAB, Julia>>=df[df$score >= 50, ]
Excel / Google Sheets>>==IF(A2>=50,"Pass","Fail")
Fortran.GT. / >.GE. / >=IF (X .GE. 0)

Common mistakes

  • => is not “greater or equal”. It is an arrow function in JavaScript, a hash/array pair in PHP and Ruby, and a syntax error as a comparison in most languages. Always write >=.
  • Bash: inside [ ], > redirects output to a file and inside [[ ]] it compares strings alphabetically. Use -gt/-ge or (( )) for numbers.
  • JavaScript: "10" > "9" is false because strings compare character by character. Convert with Number() first.
  • Floating point: 0.1 + 0.2 <= 0.3 is false in most languages because the sum is stored as 0.30000000000000004; compare with a small tolerance.
  • Unicode ≥ is not an operator in mainstream languages – fonts with ligatures (Fira Code, JetBrains Mono) only display >= as ≥.

Shell redirect: > and >>

On the command line, > writes output to a file (overwriting it) and >> appends: echo hi > log.txt, echo again >> log.txt. 2> redirects errors.

Frequently asked questions

Is it >= or => for greater than or equal to?

Always >=. The order => is an arrow (JavaScript) or key-value separator (PHP, Ruby), not a comparison.

How do you write greater than or equal to in Python?

Use >=, for example if score >= 90:. Python also allows chained comparisons like 0 <= x < 10.

How do I compare numbers in Bash?

Use -gt, -ge, -lt, -le, -eq, -ne inside [ ], or arithmetic (( a >= b )).

Is SQL BETWEEN inclusive?

Yes. x BETWEEN 10 AND 20 is the same as x >= 10 AND x <= 20.