Skip to content
Zach Ward edited this page Aug 16, 2019 · 21 revisions

Amua interprets many types of mathematical expressions. Expressions can be composed of:

Each mathematical object is represented internally as a Numeric object. A Numeric object can be of different types:

  • INTEGER: Integer (32-bit signed two's complement integer, which has a minimum value of -231 and a maximum value of 231-1)
  • DOUBLE: Real number (double-precision 64-bit IEEE 754 floating point)
  • BOOL: Boolean value equal to true or false
  • MATRIX: Matrix (or vector) of DOUBLE elements. A matrix can be defined as a table or in the expression using square brackets: [[1 , 2], [3, 4]]. Individual elements are accessed by index (starting from 0), using square brackets. For example, the first element of a row vector is accessed as vector[0] (where vector is the name of the vector). Matrix elements are accessed by matrix[row,column]. See matrix tables for more details.

Amua dynamically infers each object's type and performs the appropriate operation. An error will be thrown if object types are not conformable.

Integer types are preserved when possible, but sometimes real numbers (double type) are returned from functions, ex: 3.0. To convert back to an integer (for indexing matrices, for example) the result can simply be divided by 1 (integer type), ex: 3.0/1 -> 3.