\section{rand.h File Reference}
\label{rand.h}\index{rand.h@{rand.h}}
Random generator using the linear congruential method. 


\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf initrand} ({\bf UINT16} seed) NONBANKED
\begin{CompactList}\small\item\em Initalise the random number generator.\item\end{CompactList}

\item 
\label{rand.h_a1}
\index{rand@{rand}!rand.h@{rand.h}}\index{rand.h@{rand.h}!rand@{rand}}
{\bf INT8} {\bf rand} (void)
\begin{CompactList}\small\item\em Returns a random value.\item\end{CompactList}

\item 
\label{rand.h_a2}
\index{randw@{randw}!rand.h@{rand.h}}\index{rand.h@{rand.h}!randw@{randw}}
{\bf UINT16} {\bf randw} (void)
\begin{CompactList}\small\item\em Returns a random word.\item\end{CompactList}

\item 
void {\bf initarand} ({\bf UINT16} seed)
\begin{CompactList}\small\item\em Random generator using the linear lagged additive method Note that '{\bf initarand}() {\rm (p.~\pageref{rand.h_a3})}' calls '{\bf initrand}() {\rm (p.~\pageref{rand.h_a0})}' with the same seed value, and uses '{\bf rand}() {\rm (p.~\pageref{rand.h_a1})}' to initialize the random generator.\item\end{CompactList}

\item 
\label{rand.h_a4}
\index{arand@{arand}!rand.h@{rand.h}}\index{rand.h@{rand.h}!arand@{arand}}
{\bf INT8} {\bf arand} (void)
\begin{CompactList}\small\item\em Generates a random number using the linear lagged additive method.\item\end{CompactList}

\end{CompactItemize}
\vspace{0.4cm}\hrule\vspace{0.2cm}
\subsection*{Detailed Description}
Random generator using the linear congruential method.

\begin{Desc}
\item[{\bf Author(s): }]\par
Luc Van den Borre \end{Desc}
\vspace{0.4cm}\hrule\vspace{0.2cm}
\subsection*{Function Documentation}
\label{rand.h_a0}
\index{rand.h@{rand.h}!initrand@{initrand}}
\index{initrand@{initrand}!rand.h@{rand.h}}
\subsection{\setlength{\rightskip}{0pt plus 5cm}void initrand ({\bf UINT16} {\em seed})}

Initalise the random number generator.

seed needs to be different each time, else the same sequence will be generated. A good source is the DIV register. \label{rand.h_a3}
\index{rand.h@{rand.h}!initarand@{initarand}}
\index{initarand@{initarand}!rand.h@{rand.h}}
\subsection{\setlength{\rightskip}{0pt plus 5cm}void initarand ({\bf UINT16} {\em seed})}

Random generator using the linear lagged additive method Note that '{\bf initarand}() {\rm (p.~\pageref{rand.h_a3})}' calls '{\bf initrand}() {\rm (p.~\pageref{rand.h_a0})}' with the same seed value, and uses '{\bf rand}() {\rm (p.~\pageref{rand.h_a1})}' to initialize the random generator.

\begin{Desc}
\item[{\bf Author(s): }]\par
Luc Van den Borre \end{Desc}
