Logical Data

Logical (Boolean) data consists of only ones and zeros. The relational functions

(> 2 < <+) generate logical data as their result; the result is 1 if the condition was

true ahd 0 if the condition was false. The output can then be used as arguments

to the logical functions (AZd-1 to check for certain conditions being true or false.

SCALAR

A single item, whether a single number or single character constant, is called a scalar.

It has no coordinates; that is, it can be thought of as a geometric point. The follow-

ing are examples of scalars:

Scalars can be used directly in calculations or can be assigned to a variable name.

The variable name for the scalar can then be used in the calculations:

ARRAYS

Array is the general term for a collection of data, and includes scalars (single data

items), vectors (strings of data), matrices (tables of data), and arrays of higher

dimensions (multiple tables). All primitive (built-in) functions are designed to handle

arrays. Some functions are designed specifically to handle arrays rather than scalars.

Indexing, for example, can select certain elements from an array for processing.

One of the simplest kinds of arrays, the vector, has only one dimension; it can be

thought of as a collection of elements arranged along a horizontal line. The num-

bers that indicate the positions of elements in an array are called indices. An element

can be selected from a vector by a single index, since a vector has only one dimen-

sion. The following example shows assigning a numeric and a character vector to two

variable names, N

and C; the names are then entered to display the values they re-

present:

10 i

32

Logical (Boolean) data consists of only ones and zeros. The relational functions

(> 2 < <+) generate logical data as their result; the result is 1 if the condition was

true ahd 0 if the condition was false. The output can then be used as arguments

to the logical functions (AZd-1 to check for certain conditions being true or false.

SCALAR

A single item, whether a single number or single character constant, is called a scalar.

It has no coordinates; that is, it can be thought of as a geometric point. The follow-

ing are examples of scalars:

Scalars can be used directly in calculations or can be assigned to a variable name.

The variable name for the scalar can then be used in the calculations:

ARRAYS

Array is the general term for a collection of data, and includes scalars (single data

items), vectors (strings of data), matrices (tables of data), and arrays of higher

dimensions (multiple tables). All primitive (built-in) functions are designed to handle

arrays. Some functions are designed specifically to handle arrays rather than scalars.

Indexing, for example, can select certain elements from an array for processing.

One of the simplest kinds of arrays, the vector, has only one dimension; it can be

thought of as a collection of elements arranged along a horizontal line. The num-

bers that indicate the positions of elements in an array are called indices. An element

can be selected from a vector by a single index, since a vector has only one dimen-

sion. The following example shows assigning a numeric and a character vector to two

variable names, N

and C; the names are then entered to display the values they re-

present:

10 i

32