\HeaderA{frexp}{Function to convert vector of floating-point numbers to fractional and integral components}{frexp}
\keyword{manip}{frexp}
\keyword{misc}{frexp}
\keyword{math}{frexp}
\begin{Description}\relax
The  frexp() function returns a matrix with the normalized fraction [.5,1) of the vector in the first
column and the exponent (a power of two) in the second column. (If x is zero,
then the normalized fraction is zero and zero is stored in the exponent.)
\end{Description}
\begin{Usage}
\begin{verbatim}
        frexp(v)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{v}] vector of doubles 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This is an R wrapper around the \textless{}math.h\textgreater{} frexp() function.
\end{Details}
\begin{Value}
Returns a 2xn matrix. Thethe normalized fraction [.5,1) of x is the first
column and the exponent (a power of two) in the second column. (If x[i] is zero,
then the normalized fraction of x[i] is zero and zero is stored in the exponent.)
\end{Value}
\begin{Author}\relax
Micah Altman
\email{Micah\_Altman\@harvard.edu}
\url{http://www.hmdc.harvard.edu/micah_altman/}
\end{Author}
\begin{References}\relax
Altman, M., J. Gill and M. P. McDonald.  2003.  \emph{Numerical Issues in Statistical
Computing for the Social Scientist}.  John Wiley \& Sons.
\url{http://www.hmdc.harvard.edu/numerical_issues/}
\end{References}
\begin{Examples}
\begin{ExampleCode}
x = runif(10)
y = frexp(x)
y
# this is now true by construction
x==y[,1] *2^y[,2]

\end{ExampleCode}
\end{Examples}

