Data Types

There are three fundamental types of data that you manipulate in RLaB : the string; the real number; and the complex number. As we have seen in section [*], it is straight-forward to manipulate numerical quantities. Characters are available in the form of strings which can contain 0 or more characters. In line with a philosophy to ``keep it simple'', RLaB   which is primarily concerned with numerical computation, has no special way to handle a single character5. To enter a string, enclose the characters inside quotes like "this" e.g.

> "Hello world"
Hello world

Just as a number was previously stored in a variable, the same can be done with a string of characters. To place a string into a variable, you could enter a statement such as

> hw = "Hello world"
Hello world

and the value of variable hw may be printed out by entering

> hw
Hello world

The observant reader might be wondering what has happened to the boolean data type? In RLaB , true and false are represented by the integers 1 and 0. Just as the data type char can be handled as a rather small string (length=1), so the data type boolean (or logical) can be handled by small numbers (value=0,1). We have now met the 3 fundamental types of data processed in RLaB  and it is now possible to understand a little more about how data structures and functions are organised within RLaB .