function
<cmath> <ctgmath>
frexpdouble frexp (double x, int* exp);
double frexp (double x , int* exp); float frexpf (float x , int* exp);long double frexpl (long double x, int* exp);
double frexp (double x , int* exp); float frexp (float x , int* exp);long double frexp (long double x, int* exp);
double frexp (double x , int* exp); float frexp (float x , int* exp);long double frexp (long double x, int* exp); double frexp (T x , int* exp); // additional overloads for integral types
Get significand and exponent
Breaks the floating point number x into its binary significand (a floating point with an absolute value between0.5
(included) and 1.0
(excluded)) and an integral exponent for 2
, such that:
x = significand * 2 exponent
If x is zero, both parts (significand and exponent) are zero.
Header
<tgmath.h>provides a type-generic macro version of this function.
are provided in this header (
<cmath>
) for the
integral types: These overloads effectively cast
xto a
double
before calculations (defined for
Tbeing any
integral type).
int
where the value of the exponent is stored.
[0.5,1)
which, once multiplied by 2
raised to the power of exp, yields x.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* frexp example */
#include <stdio.h> /* printf */
#include <math.h> /* frexp */
int main ()
{
double param, result;
int n;
param = 8.0;
result = frexp (param , &n);
printf ("%f = %f * 2^%d\n", param, result, n);
return 0;
}
8.000000 = 0.500000 * 2^4
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4