Script Function Reference

Function Reference >Script Function Reference >Table Formats>number

Number

The number format is a table representing a complex number.
x.type = "number"
x.r -- is the real part of the complex number
x.i -- is the imaginary part of the complex number
Here is an example using the number format.
function add(a, b)
  ret = {}
  ret.type = "number"
  ret.r = a.r + b.r
  ret.i = a.i + b.i
  return ret
end