% -*- Mode: TeX -*-
\beginsubsection{Numeric Operations}
\DefineSection{NumericOperations}
\clisp\ provides a large variety of operations related to \term{numbers}.
This section provides an overview of those operations by grouping them
into categories that emphasize some of the relationships among them.
\Thenextfigure\ shows \term{operators} relating to
arithmetic operations.
\displaythree{Operators relating to Arithmetic.}{
*&1+&gcd\cr
+&1-&incf\cr
-&conjugate&lcm\cr
/&decf&\cr
}
\Thenextfigure\ shows \term{defined names} relating to
exponential, logarithmic, and trigonometric operations.
\displaythree{Defined names relating to Exponentials, Logarithms, and Trigonometry.}{
abs&cos&signum\cr
acos&cosh&sin\cr
acosh&exp&sinh\cr
asin&expt&sqrt\cr
asinh&isqrt&tan\cr
atan&log&tanh\cr
atanh&phase&\cr
cis&pi&\cr
}
\Thenextfigure\ shows \term{operators} relating to
numeric comparison and predication.
\displaythree{Operators for numeric comparison and predication.}{
/=&>=&oddp\cr
<&evenp&plusp\cr
<=&max&zerop\cr
=&min&\cr
>&minusp&\cr
}
\Thenextfigure\ shows \term{defined names} relating to
numeric type manipulation and coercion.
\displaythree{Defined names relating to numeric type manipulation and coercion.}{
ceiling&float-radix&rational\cr
complex&float-sign&rationalize\cr
decode-float&floor&realpart\cr
denominator&fround&rem\cr
fceiling&ftruncate&round\cr
ffloor&imagpart&scale-float\cr
float&integer-decode-float&truncate\cr
float-digits&mod&\cr
float-precision&numerator&\cr
}
\beginsubsubsection{Associativity and Commutativity in Numeric Operations}
For functions that are mathematically associative (and possibly commutative),
a \term{conforming implementation} may process the \term{arguments} in any manner
consistent with associative (and possibly commutative) rearrangement. This does not
affect the order in which the \term{argument} \term{forms} are \term{evaluated};
for a discussion of evaluation order, \seesection\FunctionForms.
What is unspecified is only the order in which the \term{parameter} \term{values}
are processed. This implies that \term{implementations} may differ in which
automatic \term{coercions} are applied; \seesection\NumericContagionRules.
A \term{conforming program} can control the order of processing explicitly by
separating the operations into separate (possibly nested) \term{function forms},
or by writing explicit calls to \term{functions} that perform coercions.
\beginsubsubsubsection{Examples of Associativity and Commutativity in Numeric Operations}
Consider the following expression, in which we assume that \f{1.0} and
\f{1.0e-15} both denote \term{single floats}:
\code
(+ 1/3 2/3 1.0d0 1.0 1.0e-15)
\endcode
One \term{conforming implementation} might
process the \term{arguments} from left to right,
first adding \f{1/3} and \f{2/3} to get \f{1},
then converting that to a \term{double float}
for combination with \f{1.0d0},
then successively converting and adding \f{1.0} and \f{1.0e-15}.
Another \term{conforming implementation} might process the \term{arguments} from
right to left, first performing a \term{single float} addition of \f{1.0} and
\f{1.0e-15} (perhaps losing accuracy in the process), then converting the sum to
a \term{double float} and adding \f{1.0d0}, then converting \f{2/3} to a
\term{double float} and adding it, and then converting \f{1/3} and adding that.
A third \term{conforming implementation} might first scan all the \term{arguments},
process all the \term{rationals} first to keep that part of the computation exact,
then find an \term{argument} of the largest floating-point format among all the
\term{arguments} and add that, and then add in all other \term{arguments}, converting
each in turn (all in a perhaps misguided attempt to make the computation as accurate
as possible).
In any case, all three strategies are legitimate.
A \term{conforming program} could control the order by writing, for example,
\code
(+ (+ 1/3 2/3) (+ 1.0d0 1.0e-15) 1.0)
\endcode
\endsubsubsubsection%{Examples of Associativity and Commutativity in Numeric Operations}
\endsubsubsection%{Associativity and Commutativity in Numeric Operations}
\beginsubsubsection{Contagion in Numeric Operations}
\DefineSection{NumericContagionRules}
For information about the contagion rules for implicit coercions of \term{arguments}
in numeric operations, see
\secref\RuleOfFloatPrecisionContagion,
\secref\RuleOfFloatAndRationalContagion,
and \secref\RuleOfComplexContagion.
\endsubsubsection%{Contagion in Numeric Operations}
\beginsubsubsection{Viewing Integers as Bits and Bytes}
\beginsubsubsubsection{Logical Operations on Integers}
%% 12.7.0 1
%% 12.7.0 2
Logical operations require \term{integers} as arguments;
%!!! Is this a formal use of "should be signaled"? -kmp 13-May-91
an error \oftype{type-error} should be signaled
if an argument is supplied that is not an \term{integer}.
\term{Integer} arguments to logical operations are treated as if
they were represented in two's-complement notation.
%Internally an implementation
%might or might not use a two's-complement representation.
\Thenextfigure\ shows \term{defined names} relating to
logical operations on numbers.
\displaythree{Defined names relating to logical operations on numbers.}{
ash&boole-ior&logbitp\cr
boole&boole-nand&logcount\cr
boole-1&boole-nor&logeqv\cr
boole-2&boole-orc1&logior\cr
boole-and&boole-orc2&lognand\cr
boole-andc1&boole-set&lognor\cr
boole-andc2&boole-xor&lognot\cr
boole-c1&integer-length&logorc1\cr
boole-c2&logand&logorc2\cr
boole-clr&logandc1&logtest\cr
boole-eqv&logandc2&logxor\cr
}
\endsubsubsubsection%{Logical Operations on Integers}
\beginsubsubsubsection{Byte Operations on Integers}
%% 12.8.0 2
The byte-manipulation \term{functions} use \term{objects}
called \term{byte specifiers} to designate the size and position
of a specific \term{byte} within an \term{integer}.
The representation of a \term{byte specifier} is \term{implementation-dependent};
it might or might not be a \term{number}.
\Thefunction{byte} will construct a \term{byte specifier},
which various other byte-manipulation \term{functions} will accept.
\Thenextfigure\ shows \term{defined names} relating to
manipulating \term{bytes} of \term{numbers}.
\displaythree{Defined names relating to byte manipulation.}{
byte&deposit-field&ldb-test\cr
byte-position&dpb&mask-field\cr
byte-size&ldb&\cr
}
\endsubsubsubsection%{Byte Operations on Integers}
\endsubsubsection%{Viewing Integers as Bits and Bytes}
\endsubsection%{Numeric Operations}
\beginSubsection{Implementation-Dependent Numeric Constants}
\Thenextfigure\ shows \term{defined names} relating to
\term{implementation-dependent} details about \term{numbers}.
\displaytwo{Defined names relating to implementation-dependent details about numbers.}{
double-float-epsilon&most-negative-fixnum\cr
double-float-negative-epsilon&most-negative-long-float\cr
least-negative-double-float&most-negative-short-float\cr
least-negative-long-float&most-negative-single-float\cr
least-negative-short-float&most-positive-double-float\cr
least-negative-single-float&most-positive-fixnum\cr
least-positive-double-float&most-positive-long-float\cr
least-positive-long-float&most-positive-short-float\cr
least-positive-short-float&most-positive-single-float\cr
least-positive-single-float&short-float-epsilon\cr
long-float-epsilon&short-float-negative-epsilon\cr
long-float-negative-epsilon&single-float-epsilon\cr
most-negative-double-float&single-float-negative-epsilon\cr
}
\endSubsection%{Implementation-Dependent Numeric Constants}
\beginsubsection{Rational Computations}
\DefineSection{RationalComputations}
%% 12.1.0 2
The rules in this section apply to \term{rational} computations.
\beginsubsubsection{Rule of Unbounded Rational Precision}
Rational computations cannot overflow in the usual sense
(though there may not be enough storage to represent a result),
since \term{integers} and \term{ratios} may in principle be of any magnitude.
\endsubsubsection%{Rule of Unbounded Rational Precision}
\beginsubsubsection{Rule of Canonical Representation for Rationals}
%% 2.1.2 2
%% 12.1.0 5
If any computation produces a result that is a mathematical ratio of two integers
such that the denominator evenly divides the numerator, then the result is converted
to the equivalent \term{integer}.
%% 2.1.2 1
%% This had been removed, but I couldn't figure out why,
%% so I reinstated it. -kmp 19-Oct-91
If the denominator does not evenly divide the numerator,
the canonical representation of a \term{rational} number is as the \term{ratio}
that numerator and that denominator, where the greatest common divisor of
the numerator and denominator is one, and where the denominator is positive
and greater than one.
When used as input (in the default syntax),
the notation \f{-0} always denotes the \term{integer} \f{0}.
A \term{conforming implementation} must not have a
representation of ``minus zero'' for \term{integers}
that is distinct from its representation of zero for \term{integers}.
However, such a distinction is possible for \term{floats};
see \thetype{float}.
\endsubsubsection%{Rule of Canonical Representation for Rationals}
\beginsubsubsection{Rule of Float Substitutability}
\DefineSection{FloatSubstitutability}
%% 12.5.0 4
When the arguments to an irrational mathematical \term{function}
\reviewer{Barmar: There should be a table of these functions.}
are all \term{rational} and the true mathematical result
is also (mathematically) rational, then unless otherwise noted
an implementation is free to return either an accurate
\term{rational} result
or a \term{single float} approximation.
If the arguments are all \term{rational}
but the result cannot be expressed
as a \term{rational} number, then a \term{single float}
approximation is always returned.
\issue{COMPLEX-RATIONAL-RESULT:EXTEND}
If the arguments to
%% Added "irrational" per Boyer/Kaufmann/Moore #14 (by X3J13 vote at May 4-5, 1994 meeting)
%% -kmp 9-May-94
%a
an irrational
mathematical \term{function} are all of type
\f{(or rational (complex rational))}
and the true mathematical result is
(mathematically) a complex number with rational real and imaginary
parts, then unless otherwise noted an implementation is free to return
either an accurate result of type \f{(or rational (complex rational))}
or
a \term{single float}
(permissible only if the imaginary part of the true mathematical
result is zero) or \f{(complex single-float)}. If the arguments are
all of type \f{(or rational (complex rational))}
but the result cannot be
expressed as a \term{rational} or \term{complex rational},
then the returned
value will be \oftype{single-float}
(permissible only if the imaginary
part of the true mathematical result is zero) or \f{(complex single-float)}.
\endissue{COMPLEX-RATIONAL-RESULT:EXTEND}
%% Added per Boyer/Kaufmann/Moore #14 (by X3J13 vote at May 4-5, 1994 meeting)
%% -kmp 9-May-94
Float substitutability applies neither to the rational \term{functions}
\funref{+},
\funref{-},
\funref{*},
and \funref{/}
nor to the related \term{operators}
\funref{1+},
\funref{1-},
\macref{incf},
\macref{decf},
and \funref{conjugate}.
For rational \term{functions},
if all arguments are \term{rational},
then the result is \term{rational};
if all arguments are of type \f{(or rational (complex rational))},
then the result is of type \f{(or rational (complex rational))}.
\tablefigtwo{Functions Affected by Rule of Float Substitutability}%
{Function}{Sample Results}{
\funref{abs} & \f{(abs \#c(3 4)) \EV\ 5 \i{or} 5.0} \cr
\funref{acos} & \f{(acos 1) \EV\ 0 \i{or} 0.0} \cr
\funref{acosh} & \f{(acosh 1) \EV\ 0 \i{or} 0.0} \cr
\funref{asin} & \f{(asin 0) \EV\ 0 \i{or} 0.0} \cr
\funref{asinh} & \f{(asinh 0) \EV\ 0 \i{or} 0.0} \cr
\funref{atan} & \f{(atan 0) \EV\ 0 \i{or} 0.0} \cr
\funref{atanh} & \f{(atanh 0) \EV\ 0 \i{or} 0.0} \cr
%% #c(1 0) => 1 per Boyer/Kaufmann/Moore #14 (by X3J13 vote at May 4-5, 1994 meeting)
%% -kmp 9-May-94
\funref{cis} & \f{(cis 0) \EV\ 1 \i{or} \#c(1.0 0.0)} \cr
\funref{cos} & \f{(cos 0) \EV\ 1 \i{or} 1.0} \cr
\funref{cosh} & \f{(cosh 0) \EV\ 1 \i{or} 1.0} \cr
\funref{exp} & \f{(exp 0) \EV\ 1 \i{or} 1.0} \cr
\funref{expt} & \f{(expt 8 1/3) \EV\ 2 \i{or} 2.0} \cr
\funref{log} & \f{(log 1) \EV\ 0 \i{or} 0.0} \cr
& \f{(log 8 2) \EV\ 3 \i{or} 3.0} \cr
\funref{phase} & \f{(phase 7) \EV\ 0 \i{or} 0.0} \cr
\funref{signum} & \f{(signum \#c(3 4)) \EV\ \#c(3/5 4/5) \i{or} \#c(0.6 0.8)} \cr
\funref{sin} & \f{(sin 0) \EV\ 0 \i{or} 0.0} \cr
\funref{sinh} & \f{(sinh 0) \EV\ 0 \i{or} 0.0} \cr
\funref{sqrt} & \f{(sqrt 4) \EV\ 2 \i{or} 2.0} \cr
& \f{(sqrt 9/16) \EV\ 3/4 \i{or} 0.75} \cr
\funref{tan} & \f{(tan 0) \EV\ 0 \i{or} 0.0} \cr
\funref{tanh} & \f{(tanh 0) \EV\ 0 \i{or} 0.0} \cr
}
\endsubsubsection%{Rule of Float Substitutability}
\endsubsection%{Rational Computations}
\beginsubsection{Floating-point Computations}
\DefineSection{FloatingPointComputations}
The following rules apply to floating point computations.
\issue{CONTAGION-ON-NUMERICAL-COMPARISONS:TRANSITIVE}
\beginsubsubsection{Rule of Float and Rational Contagion}
\DefineSection{RuleOfFloatAndRationalContagion}
%% Barmar noted that the following was said in two different places.
%% I've removed the most casually worded of the two.
%% Hopefully no useful info was lost in the process. -kmp 19-Oct-91
% For \term{functions} that combine arguments of different \term{types},
% when one argument is a \term{rational} and the other is a \term{float},
% the \term{rational} is first converted to a \term{float} of the same format.
% For \term{functions} that compare arguments of different \term{types},
% when one argument is a \term{rational} and the other is
% a \term{float}, \thefunction{rational} is effectively
% called to convert the \term{float} to a \term{rational} and then an exact
% comparison is performed. In the case of \term{complex} numbers, the real and
% imaginary parts are effectively handled individually.
%% 12.1.0 3
When \term{rationals} and \term{floats} are combined by a numerical function,
the \term{rational} is first converted to a \term{float} of the same format.
For \term{functions} such as \funref{+} that take more than two arguments,
it is permitted that part of the operation be carried out exactly using
\term{rationals} and the rest be done using floating-point arithmetic.
When \term{rationals} and \term{floats} are compared by a numerical function,
\thefunction{rational} is effectively called to convert the \term{float}
to a \term{rational} and then an exact
comparison is performed. In the case of \term{complex} numbers,
the real and imaginary parts are effectively handled individually.
\beginsubsubsubsection{Examples of Rule of Float and Rational Contagion}
\code
;;;; Combining rationals with floats.
;;; This example assumes an implementation in which
;;; (float-radix 0.5) is 2 (as in IEEE) or 16 (as in IBM/360),
;;; or else some other implementation in which 1/2 has an exact
;;; representation in floating point.
(+ 1/2 0.5) \EV 1.0
(- 1/2 0.5d0) \EV 0.0d0
(+ 0.5 -0.5 1/2) \EV 0.5
;;;; Comparing rationals with floats.
;;; This example assumes an implementation in which the default float
;;; format is IEEE single-float, IEEE double-float, or some other format
;;; in which 5/7 is rounded upwards by FLOAT.
(< 5/7 (float 5/7)) \EV \term{true}
(< 5/7 (rational (float 5/7))) \EV \term{true}
(< (float 5/7) (float 5/7)) \EV \term{false}
\endcode
% (< 5/7 (rationalize (float 5/7))) \EV \term{implementation-dependent}
% Moon: The rationalize example is screwy since the two lines preceding it are also
% implementation-dependent. Also I don't think it sheds any light on
% the issue at hand (see the name of the subsubsection), so flush it.
\endsubsubsection%{Examples of Rule of Float and Rational Contagion}
\endissue{CONTAGION-ON-NUMERICAL-COMPARISONS:TRANSITIVE}
\endsubsubsection%{Rule of Float and Rational Contagion}
\beginsubsubsection{Rule of Float Approximation}
%% 12.1.0 1
%% 12.5.0 3
Computations with \term{floats} are only approximate,
although they are described as if the results
were mathematically accurate.
Two mathematically identical
expressions may be computationally different because of errors
inherent in the floating-point approximation process.
The precision of a \term{float} is not necessarily
correlated with the accuracy of that number.
For instance, 3.142857142857142857 is a more precise approximation
to $\pi$ than 3.14159, but the latter is more accurate.
The precision refers to the number of bits retained in the representation.
When an operation combines a \term{short float} with a
\term{long float},
the result will be a \term{long float}.
\clisp\ functions assume that the accuracy of
arguments to them does not exceed their precision. Therefore
when two \term{small floats}
are combined, the result is a \term{small float}.
\clisp\ functions
never convert automatically from a larger size to a smaller one.
\endsubsubsection%{Rule of Float Approximation}
\beginsubsubsection{Rule of Float Underflow and Overflow}
%% 12.1.0 2
An error of \term{type} \typeref{floating-point-overflow}
or \typeref{floating-point-underflow} should be signaled if a
floating-point computation causes exponent overflow or underflow, respectively.
\endsubsubsection%{Rule of Float Underflow and Overflow}
\beginsubsubsection{Rule of Float Precision Contagion}
\DefineSection{RuleOfFloatPrecisionContagion}
%% The following was said in two different places.
%% I've removed the most casually worded of the two.
%% Hopefully no useful info was lost in the process. -kmp 19-Oct-91
% When a shorter \term{float} is combined with a longer one in an operation,
% the result will be of the \term{type} of the longer of the two \term{floats}.
%% 12.1.0 5
The result of a numerical function is a \term{float} of the
largest format among all the floating-point arguments to the \term{function}.
\endsubsubsection%{Rule of Float Precision Contagion}
\endsubsection%{Floating-point Computations}
\beginsubsection{Complex Computations}
\DefineSection{ComplexComputations}
%% 12.1.0 6
The following rules apply to \term{complex} computations:
\beginsubsubsection{Rule of Complex Substitutability}
%% Rewritten by KMP.
% Except during the execution of irrational and transcendental \term{functions},
% \term{complex} numbers never result from a numerical \term{function}
% unless one or more of the \term{arguments} is \term{complex}.
Except during the execution of irrational and transcendental \term{functions},
no numerical \term{function} ever \term{yields} a \term{complex} unless
one or more of its \term{arguments} is a \term{complex}.
\endsubsubsection%{Rule of Complex Substitutability}
\beginsubsubsection{Rule of Complex Contagion}
\DefineSection{RuleOfComplexContagion}
% When a
% \issue{REAL-NUMBER-TYPE:X3J13-MAR-89}
% \term{real}
% \endissue{REAL-NUMBER-TYPE:X3J13-MAR-89}
% number
% \reviewer{Barmar: I don't like the word `meets' here.}
% \editornote{KMP: This is all said redundantly in \secref\ComplexComputations\ below,
% so maybe we can merge the two, somehow.} %!!! 26-Dec-90
% meets a \term{complex} number, the
% \issue{REAL-NUMBER-TYPE:X3J13-MAR-89}
% \term{real}
% \endissue{REAL-NUMBER-TYPE:X3J13-MAR-89}
% number is in effect first converted to a
% \term{complex} number by providing an
% imaginary part of {\tt $0$}.
When a
\issue{REAL-NUMBER-TYPE:X3J13-MAR-89}
\term{real}
\endissue{REAL-NUMBER-TYPE:X3J13-MAR-89}
and
a \term{complex} are both part of a computation,
the
\issue{REAL-NUMBER-TYPE:X3J13-MAR-89}
\term{real}
\endissue{REAL-NUMBER-TYPE:X3J13-MAR-89}
is first converted to a \term{complex} by providing an imaginary part of \f{0}.
\endsubsubsection%{Rule of Complex Contagion}
\beginsubsubsection{Rule of Canonical Representation for Complex Rationals}
\DefineSection{RuleOfCanonRepForComplexRationals}
%% 12.1.0 8
If the result of any computation would be a \term{complex}
number whose real part is \oftype{rational} and whose imaginary
part is zero, the result is converted to the \term{rational}
which is the real part.
This rule does not apply to \term{complex} numbers whose parts
are \term{floats}.
For example, \f{\#C(5 0)} and \f{5} are not \term{different} \term{objects} in \clisp
(they are always the \term{same} under \funref{eql});
\f{\#C(5.0 0.0)} and \f{5.0} are always \term{different} \term{objects} in \clisp\
(they are never the \term{same} under \funref{eql},
although they are the \term{same} under \funref{equalp} and \funref{=}).
\beginsubsubsubsection{Examples of Rule of Canonical Representation for Complex Rationals}
\code
#c(1.0 1.0) \EV #C(1.0 1.0)
#c(0.0 0.0) \EV #C(0.0 0.0)
#c(1.0 1) \EV #C(1.0 1.0)
#c(0.0 0) \EV #C(0.0 0.0)
#c(1 1) \EV #C(1 1)
#c(0 0) \EV 0
(typep #c(1 1) '(complex (eql 1))) \EV \term{true}
(typep #c(0 0) '(complex (eql 0))) \EV \term{false}
\endcode
\endsubsubsubsection%{Examples of Rule of Canonical Representation for Complex Rationals}
\endsubsubsection%{Rule of Canonical Representation for Complex Rationals}
\beginsubsubsection{Principal Values and Branch Cuts}
%% 12.5.3 1
Many of the irrational and transcendental functions are multiply defined
in the complex domain; for example, there are in general an infinite
number of complex values for the logarithm function. In each such
case, a \term{principal} \term{value} must be chosen for the function to return.
In general, such values cannot be chosen so as to make the range
continuous; lines in the domain
called branch cuts must be defined, which in turn
define the discontinuities in the range.
%% 12.5.3 2
\clisp\ defines the branch cuts, \term{principal} \term{values}, and boundary
conditions for the complex functions following ``{\PrincipalValues}.'' The branch
cut rules that apply to each function are located with the description of
that function.
%% 12.5.3 17
\Thenextfigure\ lists
the identities that are obeyed
throughout the applicable portion of the complex domain, even on
the branch cuts:
\showthree{Trigonometric Identities for Complex Domain}{
sin i z = i sinh z & sinh i z = i sin z & arctan i z = i arctanh z \cr
cos i z = cosh z & cosh i z = cos z & arcsinh i z = i arcsin z \cr
tan i z = i tanh z & arcsin i z = i arcsinh z & arctanh i z = i arctan z \cr
}
The quadrant numbers referred to in the discussions of branch cuts are as illustrated
in \thenextfigure.
% JGA requested this.
% This is amazingly low-tex and the spacing of dots isn't quite right,
% but I think it's good enough to be intelligible and will suffice until and
% unless something better is devised. -kmp 3-Feb-92
{\def\Qfont#1{{\tt #1}}
$$\vbox{\halign{\hfil #\hfil\cr
Positive\cr
Imaginary Axis\cr
\noalign{\vskip 5pt}
\vbox{\halign{#&#&#\cr
\hfil&\hfil$\vdots$\hfil&\hfil\cr
\hfil\Qfont{II\quad}&$\vdots$&\Qfont{\quad I}\hfil\cr
\hfil Negative Real Axis\quad$\cdots\cdots\cdots$& &$\cdots\cdots\cdots$\quad Positive Real Axis\hfil\cr
\hfil\Qfont{III\quad}&$\vdots$&\Qfont{\quad IV}\hfil\cr
\hfil&\hfil$\vdots$\hfil&\hfil\cr
}}\cr
\noalign{\vskip 5pt}
Negative\cr
Imaginary Axis\cr}}$$
}
\simplecaption{Quadrant Numbering for Branch Cuts}
\endsubsubsection%{Principal Values and Branch Cuts}
\endsubsection%{Complex Computations}
\beginsubsection{Interval Designators}
\DefineSection{IntervalDesignators}
The \term{compound type specifier} form of the numeric \term{type specifiers}
%% Removed per Boyer/Kaufmann/Moore #15 (by X3J13 vote at May 4-5, 1994 meeting)
%% -kmp 9-May-94
%in \thenextfigure\
permit the user to specify an interval on the real number line
which describe a \term{subtype} of the \term{type} which would be described by the
corresponding \term{atomic type specifier}. A \term{subtype} of some \term{type}
\param{T} is specified using an ordered pair of \term{objects} called
\term{interval designators} for \term{type} \param{T}.
The first of the two \term{interval designators} for \term{type} \param{T} can be
any of the following:
\beginlist
\itemitem{a number \param{N} of \term{type} \param{T}}
This denotes a lower inclusive bound of \param{N}. That is, \term{elements}
of the \term{subtype} of \param{T} will be greater than or equal to \param{N}.
\itemitem{a \term{singleton} \term{list} whose \term{element} is
a number \param{M} of \term{type} \param{T}}
This denotes a lower exclusive bound of \param{M}. That is, \term{elements}
of the \term{subtype} of \param{T} will be greater than \param{M}.
\itemitem{the symbol \misc{*}}
This denotes the absence of a lower bound on the interval.
\endlist
The second of the two \term{interval designators} for \term{type} \param{T} can be
any of the following:
\beginlist
\itemitem{a number \param{N} of \term{type} \param{T}}
This denotes an upper inclusive bound of \param{N}. That is, \term{elements}
of the \term{subtype} of \param{T} will be less than or equal to \param{N}.
\itemitem{a \term{singleton} \term{list} whose \term{element} is
a number \param{M} of \term{type} \param{T}}
This denotes an upper exclusive bound of \param{M}. That is, \term{elements}
of the \term{subtype} of \param{T} will be less than \param{M}.
\itemitem{the symbol \misc{*}}
This denotes the absence of an upper bound on the interval.
\endlist
\endsubsection%{Interval Designators}
\beginsubsection{Random-State Operations}
\Thenextfigure\ lists some \term{defined names} that are applicable to \term{random states}.
\displaythree{Random-state defined names}{
*random-state*&random&\cr
make-random-state&random-state-p&\cr
}
\endsubsection%{Random-State Operations}