Share via


frexp (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Gets the mantissa and exponent of a floating-point number.

double frexp(    doublex,int* expptr);

Parameters

  • x
    Floating-point value.
  • expptr
    Pointer to stored integer exponent.

Return Values

frexp returns the mantissa.

If x is 0, the function returns 0 for both the mantissa and the exponent.

There is no error return.

Remarks

The frexp function breaks down the floating-point value (x) into a mantissa (m) and an exponent (n), such that the absolute value of m is greater than or equal to 0.5 and less than 1.0, and x = m*2n.

The integer exponent n is stored at the location pointed to by expptr.

Example

/* FREXP.C: This program calculates frexp( 16.4, &n )
 * then displays y and n.
 */


void main( void )
{
   double x, y;
   int n;

   x = 16.4;
   y = frexp( x, &n );
   printf( "frexp( %f, &n ) = %f, n = %d\n", x, y, n );
}

Output

frexp( 16.400000, &n ) = 0.512500, n = 5

Requirements

OS Versions: Windows CE 2.0 and later
Header: stdlib.h
Link Library: coredll.dll

See Also

ldexp | modf

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.