3.7. Operators

All operators are followed by their priority. Lower is applied before bigger priorities.

3.7.1. Unary operators (name - description)

  • - Negation operator, put it before expression (-x)
  • ! Factorial operator, put it after expression (x!)

3.7.2. Definition operators

  • 8: := Attribution operator
  • 8: :> Lazy attribution operator

You can see Variables and Function definition for their use

3.7.3. Binary operators (Priority - name - description)

  • 7: :: List appending operator
  • 6: & Logical and operator
  • 6: | Logical or operator
  • 4: + Addition operator
  • 4: - Subtraction operator
  • 3: * Multiplication operator
  • 3: / Division/fraction operator
  • 2: ^ Power operator

You can see lists`for the use of `::`` & and | are only defined for Boolean.

3.7.4. Comparison operators

Scalar comparison operators, only give a result if both operand is a scalar number.

  • 5: < Lower than operator
  • 5: > Greater than operator
  • 5: >= Greater or equal operator
  • 5: <= Lower or equal operator

3.7.5. Equality operators

Eq possess two operators :

  • 5: = for scalar equality.
  • 5: != for scalar inequality.

These two operators perform uniquely on values, not on formula structure, if you want depp comparison, you should look at Matching or at Eq’s library