\section{bits.h File Reference}
\label{bits_h}\index{bits.h@{bits.h}}
{\tt \#include $<$iostream.h$>$}\par
{\tt \#include $<$limits.h$>$}\par
{\tt \#include "jsmisc.h"}\par


Include dependency graph for bits.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=103pt]{bits_h_incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=122pt]{bits_h_dep_incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
{\bf uint} {\bf reverse\_\-bits} ({\bf uint} i)
\item 
ostream\& {\bf print\_\-bits} (ostream \&os, {\bf uint} v)
\end{CompactItemize}


\subsection{Function Documentation}
\index{bits.h@{bits.h}!print_bits@{print\_\-bits}}
\index{print_bits@{print\_\-bits}!bits.h@{bits.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}ostream \& print\_\-bits (ostream \& {\em os}, {\bf uint} {\em v})\hspace{0.3cm}{\tt  [inline]}}\label{bits_h_a1}




Definition at line 25 of file bits.h.\footnotesize\begin{verbatim}00026 {
00027   uint mask=(uint)1<<31;
00028   for(uint i=1; i<=32; ++i)
00029     {
00030       os << ((v & mask) == 0) ? 0 : 1;
00031       v <<=1;
00032       if(i%8 == 0 && i != 32)
00033           os << ' ';
00034     }
00035 \end{verbatim}\normalsize 
\index{bits.h@{bits.h}!reverse_bits@{reverse\_\-bits}}
\index{reverse_bits@{reverse\_\-bits}!bits.h@{bits.h}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf uint} reverse\_\-bits ({\bf uint} {\em i})\hspace{0.3cm}{\tt  [inline]}}\label{bits_h_a0}




Definition at line 9 of file bits.h.

Referenced by Ran\-Base\-Class::Seed().\footnotesize\begin{verbatim}00010   {
00011     uint rev=0;
00012     uint numbits = (uint) sizeof(uint)*8;
00013     int bit;
00014 
00015     for(uint j=0; j<numbits; ++j)
00016       {
00017         bit = i & 0x00000001;
00018         bit <<= numbits-j-1;
00019         rev |= bit;
00020         i >>= 1;
00021       }
00022 \end{verbatim}\normalsize 
