frexp {accuracy} | R Documentation |
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.)
frexp(v)
v |
vector of doubles |
This is an R wrapper around the <math.h> frexp() function.
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.)
Micah Altman Micah_Altman@harvard.edu http://www.hmdc.harvard.edu/micah_altman/
Altman, M., J. Gill and M. P. McDonald. 2003. Numerical Issues in Statistical Computing for the Social Scientist. John Wiley & Sons. http://www.hmdc.harvard.edu/numerical_issues/
x = runif(10) y = frexp(x) y # this is now true by construction x==y[,1] *2^y[,2]