Operators

GBOML provides the following operators for elementary floating-point arithmetic, which are listed in order of decreasing precedence:

  1. Exponentiation: \(\texttt{**}\)

  2. Multiplication: \(\texttt{*}\) and Division: \(\texttt{/}\)

  3. Addition: \(\texttt{+}\) and Subtraction: \(\texttt{-}\)

Operator precedence can be overridden by using parentheses \(\texttt{(}\) and \(\texttt{)}\). Besides these elementary arithmetic operators, GBOML provides the modulo operator and the sum operator as native functions:

  • Modulo: \(\texttt{mod(<dividend>, <divisor>)}\)

  • Sum: \(\texttt{sum(<expression> for <id> in [<start>: <end>])}\)

In addition, a set of comparison operators are available in the language:

  • Equal to: \(\texttt{==}\)

  • Not equal to: \(\texttt{!=}\)

  • Less than or equal to: \(\texttt{<=}\)

  • Greater than or equal to: \(\texttt{>=}\)

  • Less than: \(\texttt{<}\)

  • Greater than: \(\texttt{>}\)

Finally, a set of logical operators are available, listed below in order of decreasing precedence:

  1. Negation: \(\texttt{not}\)

  2. Conjunction: \(\texttt{and}\)

  3. Disjunction: \(\texttt{or}\)

Note that the precedence of logical operators can also be overriden by using parentheses.