From 82ba818ff456bcd6d56a06226e3f27e98fbb55c3 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 14 Aug 2025 22:58:58 -0500 Subject: removing all downloaded devdocs files --- devdocs/c/numeric%2Fmath%2Ffrexp.html | 79 ----------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 devdocs/c/numeric%2Fmath%2Ffrexp.html (limited to 'devdocs/c/numeric%2Fmath%2Ffrexp.html') diff --git a/devdocs/c/numeric%2Fmath%2Ffrexp.html b/devdocs/c/numeric%2Fmath%2Ffrexp.html deleted file mode 100644 index 60c85cff..00000000 --- a/devdocs/c/numeric%2Fmath%2Ffrexp.html +++ /dev/null @@ -1,79 +0,0 @@ -

frexp, frexpf, frexpl

Defined in header <math.h>
float       frexpf( float arg, int* exp );
-
(1) (since C99)
double      frexp( double arg, int* exp );
-
(2)
long double frexpl( long double arg, int* exp );
-
(3) (since C99)
Defined in header <tgmath.h>
#define frexp( arg, exp )
-
(4) (since C99)
-1-3) Decomposes given floating point value x into a normalized fraction and an integral power of two.
-4) Type-generic macro: If arg has type long double, frexpl is called. Otherwise, if arg has integer type or the type double, frexp is called. Otherwise, frexpf is called, respectively.

Parameters

- - -
arg - floating point value
exp - pointer to integer value to store the exponent to

Return value

If arg is zero, returns zero and stores zero in *exp.

-

Otherwise (if arg is not zero), if no errors occur, returns the value x in the range (-1;-0.5], [0.5; 1) and stores an integer value in *exp such that x×2(*exp)=arg.

-

If the value to be stored in *exp is outside the range of int, the behavior is unspecified.

-

If arg is not a floating-point number, the behavior is unspecified.

-

Error handling

This function is not subject to any errors specified in math_errhandling.

-

If the implementation supports IEEE floating-point arithmetic (IEC 60559),

-

Notes

On a binary system (where FLT_RADIX is 2), frexp may be implemented as

-
{
-    *exp = (value == 0) ? 0 : (int)(1 + logb(value));
-    return scalbn(value, -(*exp));
-}

The function frexp, together with its dual, ldexp, can be used to manipulate the representation of a floating-point number without direct bit manipulations.

-

Example

#include <stdio.h>
-#include <math.h>
-#include <float.h>
- 
-int main(void)
-{
-    double f = 123.45;
-    printf("Given the number %.2f or %a in hex,\n", f, f);
- 
-    double f3;
-    double f2 = modf(f, &f3);
-    printf("modf() makes %.0f + %.2f\n", f3, f2);
- 
-    int i;
-    f2 = frexp(f, &i);
-    printf("frexp() makes %f * 2^%d\n", f2, i);
- 
-    i = ilogb(f);
-    printf("logb()/ilogb() make %f * %d^%d\n", f/scalbn(1.0, i), FLT_RADIX, i);
-}

Possible output:

-
Given the number 123.45 or 0x1.edccccccccccdp+6 in hex,
-modf() makes 123 + 0.45
-frexp() makes 0.964453 * 2^7
-logb()/ilogb() make 1.92891 * 2^6

References

See also

- - - - -
-
(C99)(C99)
multiplies a number by 2 raised to a power
(function)
-
(C99)(C99)(C99)
extracts exponent of the given number
(function)
-
(C99)(C99)(C99)
extracts exponent of the given number
(function)
-
(C99)(C99)
breaks a number into integer and fractional parts
(function)
C++ documentation for frexp
-

- © cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
- https://en.cppreference.com/w/c/numeric/math/frexp -

-
-- cgit v1.2.3