< (less than) operator

Type Assocation Precedence Input types Output types
binary left 3 int

This operator compares the first operand to the second operand and returns true if the first operand is smaller, or false otherwise. Examples:

  3 < 2        ; false  5 < 5        ; false  2.12 < 3     ; true  4.23 < 3.86  ; false    


  • This operator can also be used with complex operands (in which case it only compares the real parts), but this is not recommended and results in a compiler warning. You should use real, imag, cabs, or the |…| operator when comparing complex expressions.
  • a < b is equal to !(a >= b)

See Also
<= (less than or equal to) operator
> (greater than) operator

< (less than) operator