Expression

Expressions are composed of Float, variables, operators and functions. The expression is evaluated to a value of type Float.

Operators

The operators that can be used are:

  • +: Addition
  • -: Subtraction
  • *: Multiplication
  • /: Division
  • (): Parentheses, used to change the order of operations
  • ==: Is equal to, 1 if true, 0 otherwise.
  • ! =: If not equal, value is 1 if true, 0 otherwise.
  • >: Is more than, 1 if true, 0 otherwise.
  • <: Is less than, 1 if true, 0 otherwise.
  • >=: Is more than or equal to, 1 if true, 0 otherwise.
  • <=: Is less than or equal to, 1 if true, 0 otherwise.

Functions

The functions that can be used are:

  • sin(x): Sine function
  • cos(x): Cosine function
  • tan(x): Tangent function
  • abs(x): Absolute value function
  • exp(x): Exponential function
  • atan2(x): Inverse tangent function
  • ln(x): Natural logarithmic function
  • sig(x): Sign function, returns 1 when x is +0 or a positive number, returns -1 when it is -0 or a negative number
  • step(x, y): Step function, returns 1 when x < y is 0, otherwise returns 0
  • floor(x): Floor function
  • ceil(x): Ceiling function
  • round(x): Rounding function
  • max(x, y...) : Maximum function
  • min(x, y...): Minimum function
  • clamp(x, min, max): Clamp x between min and max

The radian system is used for both trigonometric and inverse trigonometric functions.