value.<indexterm><primary>DIMENSION Statement</primary></indexterm></para>
<para>For a second example consider the problem of repeatedly solving,
-by Newton's method, of the equation f(x) -
+by Newton's method<indexterm><primary>Newton's
+Method</primary></indexterm> , of the equation f(x) -
a<superscript>x</superscript> + x = 0, taking a different value for a
-each time but with the restriction that a ≥ 1. This method involves
-the repeated evaluation of the formula</para>
+each time but with the restriction that a ≥ 1. This method
+involves the repeated evaluation of the formula</para>
<mediaobject>
<imageobject>
again if |f(x)| ≥ ε. Otherwise, (i.e., |f(x)| <
ε), the next statement in sequence is executed.</para></listitem>
-<listitem><para>The PRINT statement causes three numbers - the current
-values of a, x and ε to be printed. The arrangement and form
-of the numbers on the printed page are controlled by the
-format description which is the value of the vector named
-ALPHA.<indexterm><primary>Format</primary></indexterm></para></listitem>
+<listitem><para>The PRINT statement<indexterm><primary>PRINT
+ Statement</primary></indexterm> causes three numbers - the current
+ values of a, x and ε to be printed. The arrangement and form of
+ the numbers on the printed page are controlled by the format
+ description which is the value of the vector named
+ ALPHA.<indexterm><primary>Format</primary></indexterm></para></listitem>
<listitem><para>The TRANSFER statement following causes the statement
labelled ST to be the next one performed.</para></listitem>
<para>The final example before the description of the language in
Chapter II is a more general and more elaborate illustration of
-Newton's method. Here, we consider the solution of the equation
-x<superscript>3</superscript> + ax<superscript>2</superscript> + bx +
-c = 0, starting with some input value for x<subscript>0</subscript>,
-using the iterative formula:</para>
+Newton's method.<indexterm><primary>Newton's
+Method</primary></indexterm> Here, we consider the solution of the
+equation x<superscript>3</superscript> +
+ax<superscript>2</superscript> + bx + c = 0, starting with some input
+value for x<subscript>0</subscript>, using the iterative
+formula:</para>
<mediaobject>
<imageobject>
following are "single variables:": X51, ALPHA6, LAMBDA, GROSS, while
the following are elements of arrays: BETA(C1, C2, 6), X15(Y, Z1),
J(6), J(Z1 + 5 *Z2, 5). (See <xref linkend='subscripts'/> for the
-description of subscripts.) Parentheses enclosing subscripts may not
-be omitted.</para>
+description of subscripts.)
+Parentheses<indexterm><primary>Parentheses</primary></indexterm>
+enclosing subscripts may not be omitted.</para>
</sect2>
<!-- beginpage II.3 -->
<indexterm><primary>Function Name</primary></indexterm>
+<indexterm><primary>Name</primary></indexterm>
+
<para>The name of a function consists of one to six letters or digits
followed by a period "." which must be written. The first character
of a function name must be a letter. If the function is
</sect2>
<sect2><title>Arithmetic Operations</title>
+
+<indexterm><primary>Operations, Arithmetic</primary></indexterm>
+
<para>The following arithmetic
operations<indexterm><primary>Arithmetic
Operations</primary></indexterm> are available:</para>
<listitem><para>Multiplication, written as "*", e.g. Z5*D. (Note that the
"*" may not be omitted. It is illegal to write Z5D, since it
would be impossible to distinguish such a product from the
-variable Z5D.)</para></listitem>
+variable Z5D.)<indexterm><primary>Multiplication</primary></indexterm>
+</para></listitem>
<listitem><para>Division, written as "/"; e.g., Z5/D. If both Z5 and
D are integers, the result is again an integer; e.g., the "fractional
D.<indexterm><primary>Exponentiation</primary></indexterm></para></listitem>
<listitem><para>Negation, written as "-", e.g., -ALOHA, meaning the
-"negative of ALOHA." Thus -X.P.-.5
-means -(X<superscript>-.5</superscript>).
-<!-- in the original, 'graph continued with ", the negative of the" -->
+"negative of ALOHA."<indexterm><primary>Negation</primary></indexterm>
+Thus -X.P.-.5 means -(X<superscript>-.5</superscript>). <!-- in the
+original, 'graph continued with ", the negative of the" -->
</para></listitem>
</orderedlist>
</sect2>
individual or subscripted array variable, then the following
are also arithmetic expressions: +E, -E, .ABS.E, E + F, E - F,
E * F, E/F, E.P.F, and (E).<indexterm><primary>.ABS.</primary></indexterm>
-<indexterm><primary>Absolute Value</primary></indexterm></para></listitem>
+<indexterm><primary>Absolute Value</primary></indexterm>
+<indexterm><primary>.P.</primary></indexterm>
+</para></listitem>
<listitem><para>The only arithmetic expressions are those arising in
(a) and (b).</para></listitem>
</sect2>
<sect2><title>Boolean Operations</title>
+
+<indexterm><primary>Operations, Boolean</primary></indexterm>
+
<para>The following Boolean, or logical, operations
<indexterm><primary>Boolean Operations</primary></indexterm>
are available in the language (where M and P are boolean expressions):</para>
<orderedlist numeration='loweralpha'>
<listitem><para>.NOT.M has the value 1B if and only if M has the value
-0B.</para></listitem>
+0B.<indexterm><primary>.NOT.</primary></indexterm></para></listitem>
<listitem><para>(M) has the same value as M.</para></listitem>
<listitem><para>M.OR.P has the value 0B if and only if both M and P
-have the value 0B.</para></listitem>
+have the value 0B.<indexterm><primary>.OR.</primary></indexterm>
+</para></listitem>
<listitem><para>M.AND.P has the value 1B if and only if both M and P
have the value 1B.
<sect2><title>Parentheses Conventions</title>
+<indexterm><primary>Parentheses</primary></indexterm>
+
<para>Parentheses are used in the same way as in ordinary algebra and
logic to specify the order of the computation. Also, certain
conventions are used to allow deletion of parentheses.
<sect2 id='expression_modes'><title>Mode of Expressions</title>
+<indexterm><primary>Mode</primary></indexterm>
+
<para>The kind of arithmetic performed on a constant, variable or
function value is determined by its mode. There are five modes in
MAD; floating point, integer, Boolean, statement label, and function
<para>or alternately the statement</para>
+<indexterm><primary>Otherwise</primary></indexterm>
+
<programlisting>
OTHERWISE
</programlisting>
variable (in
<!-- beginpage II.14 -->
the illustration: V), which may be either an individual variable or
-subscripted array variable of any mode. To the right of the "=" sign
-may appear any number of expressions E<subscript>1</subscript>,
+subscripted array variable of any mode.
+<indexterm><primary>Mode</primary></indexterm> To the right of the "="
+sign may appear any number of expressions E<subscript>1</subscript>,
... E<subscript>m</subscript>. The modes of the
E<subscript>1</subscript> bear the same relationship to the mode of V
as they would in the statement V = E<subscript>1</subscript> (see
<para>(For the meaning of the statement INTEGER J,N see <xref
linkend='mode_declaration'/>).</para>
-<para>(ii) A Newton's Method solution (X<subscript>k+1</subscript> =
+<para>(ii) A Newton's Method<indexterm><primary>Newton's
+Method</primary></indexterm> solution (X<subscript>k+1</subscript> =
x<subscript>k</subscript> -
f(x<subscript>k</subscript>)/f'(x<subscript>k</subscript>)) of the
equation f(x) = cos x - x = 0 could be written as a single statement,
-using the criterion "|f(x)| < ε and |x<subscript>k</subscript> -
-x<subscript>k</subscript>+1| =
+using the criterion "|f(x)| < ε and |x<subscript>k</subscript>
+- x<subscript>k</subscript>+1| =
|f(x<subscript>k</subscript>)/f'(x<subscript>k</subscript>)| < |
ε" for stopping the iteration:</para>
statements, they are said to be "nested". The "nesting depth" of an
iteration statement is the number of iteration statements in whose
scope it appears. The nesting depth of an iteration may not exceed
-50. <indexterm><primary>Depth, Nesting, of
-Iteration</primary></indexterm> For example:</para>
+50. <indexterm><primary>Depth, Nesting, of Iteration</primary></indexterm>
+<indexterm><primary>Nesting Depth of Iteration</primary></indexterm>
+For example:</para>
&scope4;
<!-- beginpage II.20 -->
<sect2><title>Pause Statement</title>
+<indexterm><primary>PAUSE Statement</primary></indexterm>
+
<programlisting>
PAUSE NO. n
</programlisting>
<term>(a) PRINT FORMAT &scriptF;, &scriptL;</term>
<listitem>
<para>Prints &scriptL; according to format &scriptF; on the off-line
-printer.</para>
+printer.<indexterm><primary>PRINT FORMAT Statement</primary></indexterm>
+</para>
</listitem>
</varlistentry>
<varlistentry>
<para>Prints &scriptL; according to format &scriptF; on the on-lin
printer. This statement is used for comments to the operator. After
&scriptL; has been printed a skip of 1/6 page is automatically
-produced, allowing the operator to read the comment.</para>
+produced, allowing the operator to read the comment.
+<indexterm><primary>PRINT ON LINE FORMAT Statement</primary></indexterm>
+</para>
</listitem>
</varlistentry>
<varlistentry>
10<superscript>Scale factor</superscript></para>
<para>(where the scaling is accomplished before the conversion is
-done). The "scale factor", followed by the letter "P" is prefixed to
-the basic field specification, as in the example</para>
+done). The "scale factor", followed by the letter
+"P"<indexterm><primary>P Prefix (Format)</primary></indexterm> is
+prefixed to the basic field specification, as in the example</para>
<para role='centered'>
-2P2F7.3, F7.3*
</sect3>
<sect3><title>Multiple Specifications</title>
+<indexterm><primary>Multiple Specifivcations (Format)</primary></indexterm>
+
<para>Several specifications may be condensed into one larger one by
the use of the character "/". Each appearance of "/" (except as part
of a Hollerith field-see <xref linkend='hollerith_fields'/>)
456.101 -1612.510 M = 50 J = 17
</para>
-<para>As stated above, a specification may not account for more than 72
-columns on a card. It may happen, however, that a list calls for more
-information than can appear on a single card. Or perhaps only a
+<para>As stated above, a specification may not account for more than
+72 columns on a card. It may happen, however, that a list calls for
+more information than can appear on a single card. Or perhaps only a
certain part of each card is to be read. The determining factor in
every case is whether or not the entire list has been accounted for.
After each cards is read according to the format specification, the
field. (If there is no left parenthesis, it will move to the
beginning of the specification). It then examines the characters just
to the left of this left parenthesis to see if they are a multiplicity
-indication (see <xref linkend='field_repetition'/>). From this left parenthesis (together
-with the multiplicity, if any) to the end of the specification now
-becomes the format specification until the list is satisfied. A
-similar statement may be made for printed or punched output.</para>
+indication (see <xref
+linkend='field_repetition'/>). <indexterm><primary>Multiplicity</primary></indexterm>
+From this left parenthesis (together with the multiplicity, if any) to
+the end of the specification now becomes the format specification
+until the list is satisfied. A similar statement may be made for
+printed or punched output.</para>
<para>Thus, in the specification:</para>
<sect1><title>Declarations (Non-executable statements)</title>
<indexterm><primary>Declarations</primary></indexterm>
+<indexterm><primary>Non-Executable Statements</primary></indexterm>
<para>Declarations are non-executable statements, and, except for function
declarations, they may occur anywhere in the program. Their purpose
unless declared otherwise. Any of the other modes may be specified as
the normal mode by writing the following declarations:</para>
+<indexterm><primary>Mode</primary></indexterm>
+<indexterm><primary>Mode Declaration</primary></indexterm>
+
<para role='centered'>
NORMAL MODE IS &scriptM;
</para>
(at any place) in a program. They will be treated as one combined
declaration, however.</para>
-<para>Variables whose names appear within the same set of parentheses need
-not have the same mode. The mode must be established by the
-appropriate MODE declaration for each of the variables. Occurrences
-within an EQUIVALENCE declaration do not establish mode.</para>
+<para>Variables whose names appear within the same set of parentheses
+need not have the same mode. The mode must be established by the
+appropriate MODE declaration
+<indexterm><primary>Mode</primary></indexterm> for each of the
+variables. Occurrences within an EQUIVALENCE declaration do not
+establish mode.</para>
<para>A nonsubscripted array variable<indexterm><primary>Array
Variables</primary></indexterm> name in an EQUIVALENCE statement
</sect2>
<sect2 id='VECTOR_VALUES'><title>Presetting Vectors</title>
+<indexterm><primary>Presetting Vectors</primary></indexterm>
+
<!-- The script L in this section is lowercase in the original -->
<para>Any vector or portion of a vector (or array when considered as a
vector, i.e., using linear subscripts) may be preset by a declaration
<para>There are two main types of functions: The <emphasis> internal
</emphasis> function and the <emphasis> external </emphasis> function.
-<indexterm><primary>EXTERNAL FUNCTION</primary></indexterm>
-Since these are quite similar in many ways, that part of the
-description which is specific to external functions will be
-<!-- beginpage II.42 -->
+<indexterm><primary>EXTERNAL FUNCTION</primary></indexterm> Since
+these are quite similar in many ways, that part of the description
+which is specific to external functions will be
+
+<!-- beginpage II.42 -->
+
given in <xref linkend='external_functions'/>, that which is specific
to internal functions in <xref linkend='internal_functions'/>, and
that which is common to both types will follow in subsection <xref
single-valued function will be called a "function", and a function
with multiple outputs and/or multiple exits will be called a
"procedure". For the purposes of this manual a recursive function is
-one whose definition contains calls for the function being defined ⅆ
-or calls for functions which ultimately call the one being defined.
-Recursive functions have the same structure as other functions
-although, in general, they will include statements of the type
-described in <xref linkend='list_statements'/>, and certain
+one whose definition contains calls for the function being defined
+ⅆ or calls for functions which ultimately call the one being
+defined. Recursive functions have the same structure as other
+functions although, in general, they will include statements of the
+type described in <xref linkend='list_statements'/>, and certain
considerations should be borne in mind when constructing such
-functions. These considerations arise from the fact that <emphasis>
-names </emphasis>, instead of values, are used as function arguments.
-The problem is considered in more detail in the examples in Chapter
-III.</para>
+functions. These considerations arise from the fact that<emphasis>
+names</emphasis><indexterm><primary>Name</primary></indexterm>,
+instead of values, are used as function arguments. The problem is
+considered in more detail in the examples in Chapter III.</para>
<sect3 id='external_functions'><title>External Function Definitions</title>
used. (Because of this independence this block of statements is to be
considered an entirely separate program, and must have its own
DIMENSION<indexterm><primary>DIMENSION Statement</primary></indexterm>
-and MODE declaration, etc.) The word "EXTERNAL" also implies that
-occurrences of variables and functions in the current function
-definition program have no relation whatever with occurrences of
-similarly named variables and functions in the main program (or other
-definition programs), and no difficulties will be encountered because
-of the use of similar names. The modes of the arguments (if other
-than the normal mode), must be declared in the usual way (see <xref
-linkend='mode_declaration'/>), but arrays<indexterm><primary>Array
-Variables</primary></indexterm> which are arguments need not be
+and MODE <indexterm><primary>Mode</primary></indexterm> declaration,
+etc.) The word "EXTERNAL" also implies that occurrences of variables
+and functions in the current function definition program have no
+relation whatever with occurrences of similarly named variables and
+functions in the main program (or other definition programs), and no
+difficulties will be encountered because of the use of similar names.
+The modes of the arguments (if other than the normal mode), must be
+declared in the usual way (see <xref linkend='mode_declaration'/>),
+but arrays<indexterm><primary>Array Variables</primary></indexterm>
+which are arguments need not be
dimensioned.<indexterm><primary>Arguments of
Functions</primary></indexterm></para>
"INTERNAL" also implies that any variables or functions not listed as
arguments in the definition of the
<!-- beginpage II.43 -->
-
function (but used in its evaluation), are understood to be the same
as elsewhere in the main program, and the current values of these
variables and functions will be used. Names of variables and
functions which occur as arguments of the function being defined are
designated "dummy arguments" (or "bound
variables")<indexterm><primary>Bound Variables</primary></indexterm>
-<indexterm><primary>Dummy Arguments</primary></indexterm>.
-They must be distinct from those appearing elsewhere in the program.
-The modes of dummy arguments (if other than normal mode) must be
-declared in the usual way, but arrays<indexterm><primary>Array
-Variables</primary></indexterm> which are arguments need not be
-dimensioned.<indexterm><primary>DIMENSION
+<indexterm><primary>Dummy Arguments</primary></indexterm>. They must
+be distinct from those appearing elsewhere in the program. The
+modes<indexterm><primary>Mode</primary></indexterm> of dummy arguments
+(if other than normal mode) must be declared in the usual way, but
+arrays<indexterm><primary>Array Variables</primary></indexterm> which
+are arguments need not be dimensioned.<indexterm><primary>DIMENSION
Statement</primary></indexterm></para>
<para>One form of internal function definition (not available as an external
variables, and (X, Y, Z) is the dummy
variable<indexterm><primary>Dummy Arguments</primary></indexterm>
list. The current value of T, however, will be obtained and used each
-time the value of the function is needed. An example of theuse of
+time the value of the function is needed. An example of the use of
the function so defined would be:</para>
<para role='centered'>
variable list. For this type of function definition no END OF
FUNCTION statement is required. In the user of the function is an
expression, the arguments may be any expressions that agree in mode
+<indexterm><primary>Mode</primary></indexterm>
with the corresponding argument in the declaration.</para>
<para>In the example:</para>
(statement A in the preceding paragraph) may contain only
nonsubscripted variable names (either individual or
array)<indexterm><primary>Array Variables</primary></indexterm> or
-function names (without arguments). Within the definition program
-itself (the statements between statement A and statement B), a
-function name will usually occur with arguments, and an array variable
-will usually occur with subscripts.</para>
+function names (without
+arguments). <indexterm><primary>Name</primary></indexterm> Within the
+definition program itself (the statements between statement A and
+statement B), a function name will usually occur with arguments, and
+an array variable will usually occur with subscripts.</para>
<indexterm><primary>Function Definition</primary></indexterm>
</programlisting>
<indexterm><primary>COMMNT Subroutine</primary></indexterm>
<indexterm><primary>ERROR Subroutine</primary></indexterm>
+<indexterm><primary>PRINT Subroutine</primary></indexterm>
<!-- beginpage II.49 -->
<para>If a block designation
This points up the fact that <emphasis>internally</emphasis> 0B and 1B
are stored as 0 and 1, respectively. Also, the statement</para>
+<indexterm><primary>NORMAL MODE IS Statement</primary></indexterm>
+
<para role='centered'>
NORMAL MODE IS BOOLEAN
</para>
<!-- beginpage III.30 -->
<sect2><title>Example 2<emphasis role='note'>: Payroll Tape Processing</emphasis></title>
+<indexterm><primary>Payroll Example</primary></indexterm>
+
<para>Problem: Assume that a master tape is available containing basic
information for each employee: (1) The employee number, (2) his hourly
rate, (3) gross pay to date, (4) amount of withholding tax withheld to
<!-- beginpage III.35 -->
<para role='note'><emphasis>The Program:</emphasis></para>
+<indexterm><primary>NORMAL MODE IS Statement</primary></indexterm>
+
<!-- this listing spans pages III.35, III.36, and III.36A -->
<programlisting>
&payrolltape;
<!-- beginpage III.37 -->
<sect2><title>Example 3<emphasis role='note'>: Mortgage Payment Processing</emphasis></title>
+<indexterm><primary>Mortgage Example</primary></indexterm>
+
<!-- "principle" usage error is in original -->
<para>Problem: Mortgage Payment. The type of mortgage we consider is
the fixed principle type for which each installment consists of an
<varlistentry>
<term>PRINT</term> <listitem><para>Similar to TAPEWR above except that
the use of tape 6 (the output tape) is implied. The PRINT FORMAT
-... statement produces a call for this subroutine.</para></listitem>
+... statement <indexterm><primary>PRINT FORMAT
+Statement</primary></indexterm> produces a call for this
+subroutine.<indexterm><primary>PRINT Subroutine</primary></indexterm>
+</para></listitem>
</varlistentry>
<varlistentry>
arguments are the same as PRINT except that the line spacing is not
given in the format specification since an automatic 1/6 page skip is
produced. The statement producing the call is PRINT ON LINE
-. . . .</para></listitem>
+. . . .<indexterm><primary>PRINT ON LINE FORMAT Statement</primary></indexterm>
+</para></listitem>
</varlistentry>
<varlistentry>
<indexterm><primary>Labels, Statement</primary><see>Statement, Labels</see></indexterm>
<indexterm><primary>List, Input-Output</primary><see>Input-Output List</see></indexterm>
<indexterm><primary>Matrices</primary><see>Array Variables</see></indexterm>
+<indexterm><primary>One-Dimensuiional Array</primary><see>Vector</see></indexterm>
+<indexterm><primary>OR WHENEVER Statement</primary><see>Conditional Statement</see></indexterm>
+<indexterm><primary>Parameters, Subroutine</primary><see>Subroutine Parameters</see></indexterm>
+<indexterm><primary>Precedence Hierarchy</primary><see>Parentheses</see></indexterm>
+
<index/>
</appendix>