C examples for math.h:frexp
function
<cmath> <ctgmath> <math.h>
Return the binary significand of x.
long double frexpl(long double x, int* exp); long double frexp (long double x, int* exp); double frexp (double x, int* exp); double frexp (double x , int* exp); float frexpf(float x , int* exp); double frexp (T x , int* exp);
Parameter | Description |
---|---|
x | Value to be decomposed. |
exp | Pointer to an int where the value of the exponent is stored. |
The binary significand of x.
#include <stdio.h> #include <math.h> /* frexp */ int main ()//w w w .j a v a 2s. c om { int n; double param = 8.0; double result = frexp (param , &n); printf ("%f = %f * 2^%d\n", param, result, n); return 0; }