Name
frexp, frexpf, frexpl
- convert floating-point number to fractional and integral components
Library
libm.lib
Synopsis
|
double
frexp (double value, int *exp);
|
|
float
frexpf (float value, int *exp);
|
|
long double
frexpl (long double value, int *exp);
|
Return values
These functions return the value
x,
such that
x
is a
double
with magnitude in the interval
[1/2, 1)
or zero, and
value
equals
x
times 2 raised to the power
*exp.
If
value
is zero, both parts of the result are zero.
Detailed description
The
frexp,
frexpf,
and
frexpl
functions break a floating-point number into a normalized
fraction and an integral power of 2.
They store the integer in the
int
object pointed to by
exp.
As there is no long double is not supported by SYMBIAN,
frexpl (is, aliased, to, the);
frexp
Examples
void main( void )
{
double x1 = 4.0 , y;
int res;
y = frexp( x1, &res );
printf( "frexp(%f , &res):: Int Part: %d and Fractional Part: %f \n", x1, res, y );
y = frexpf( x1, &res );
printf( "frexpf(%f , &res):: Int Part: %d and Fractional Part: %f \n", x1, res, y );
y = frexpl( x1, &res );
printf( "frexpl(%f , &res):: Int Part: %d and Fractional Part: %f \n", x1, res, y );
}
Output
frexp ( 4.0 , &res ) :: Int Part: 3 and Fractional Part: 0.5
frexpf( 4.0, &res ) :: Int Part: 3 and Fractional Part: 0.5
frexpl( 4.0, &res ) :: Int Part: 3 and Fractional Part: 0.5
Feedback
For additional information or queries on this page send feedback
© 2005-2007 Nokia
|
|