Contents Previous Next Subchapters

Representing Matrix Elements In Program Input

Integers
An integer is a sequence of digits without a decimal point. If you enter
     1234
O-Matrix will respond
     1234

Real Numbers
A real number (single precision) is a sequence of digits with a decimal point, or a number expressed in scientific notation with "e" (or "E") separating the mantissa and exponent. For example,
     5.25
will result in
     5.25
An exponent is an integer that may be preceded by a plus or minus sign. A mantissa is an integer or real number. For example, in the expression
              -2
     5.25 x 10
5.25 is the mantissa and -2 is the exponent. Entering
     5.25e-2
O-Matrix will respond
     0.0525

Double-Precision Numbers
A double-precision number is a number expressed in scientific notation using "d" (or "D") to separate the mantissa and exponent. A double-precision number has fifteen digits of precision, whereas a real number has seven.

If you enter
     5.25d-2
O-Matrix will respond
     0.0525

Complex Numbers
A complex number is a number expressed in scientific notation using "r" ("R") or "i" ("I") to separate the mantissa and exponent. The "r" signifies a purely real number while the "i" signifies a purely imaginary number. Each component of a complex number carries the same number of digits as double-precision numbers.

For example, to express the number 1, which is equal to
           0
     1 x 10
as a complex number, enter
     1r0
to which O-Matrix will respond
     (1,0)
To express 20 i, which is equal to
             1
     2 i x 10
enter
     2i1
to which O-Matrix will respond
     (0,20)

Strings
A string is a character row vector . It can be input as a sequence of characters enclosed in double quotes. The sequences of characters may not contain any carriage returns. If you enter
     "Hello World"
O-Matrix will respond
     Hello World

Logical Values
The logical values true and false can be input directly. If you enter
     print true, false
O-Matrix will respond
     T F