Download Genius Manual

Transcript
Genius Manual
14 / 88
Chapter 5
GEL Basics
GEL stands for Genius Extension Language. It is the language you use to write programs in Genius. A program in GEL is simply
an expression that evaluates to a number, a matrix, or another object in GEL. Genius Mathematics Tool can be used as a simple
calculator, or as a powerful theoretical research tool. The syntax is meant to have as shallow of a learning curve as possible,
especially for use as a calculator.
5.1
Values
Values in GEL can be numbers, Booleans, or strings. GEL also treats matrices as values. Values can be used in calculations,
assigned to variables and returned from functions, among other uses.
5.1.1
Numbers
Integers are the first type of number in GEL. Integers are written in the normal way.
1234
Hexadecimal and octal numbers can be written using C notation. For example:
0x123ABC
01234
Or you can type numbers in an arbitrary base using <base>\<number>. Digits higher than 10 use letters in a similar way to
hexadecimal. For example, a number in base 23 could be written:
23\1234ABCD
The second type of GEL number is rationals. Rationals are simply achieved by dividing two integers. So one could write:
3/4
to get three quarters. Rationals also accept mixed fraction notation. So in order to get one and three tenths you could write:
1 3/10
The next type if number is floating point. These are entered in a similar fashion to C notation. You can use E, e or @ as the
exponent delimiter. Note that using the exponent delimiter gives a float even if there is no decimal point in the number. Examples: