SW006014 Microchip Technology, SW006014 Datasheet - Page 171

C COMPILER MPLAB FOR PIC24 MCU

SW006014

Manufacturer Part Number
SW006014
Description
C COMPILER MPLAB FOR PIC24 MCU
Manufacturer
Microchip Technology
Type
MPLAB® C Compilerr
Series
PIC24r
Datasheet

Specifications of SW006014

Supported Families
PIC24
Core Architecture
PIC
Kit Contents
Software And Docs
Mcu Supported Families
PIC24
Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC24
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
© 2008 Microchip Technology Inc.
frexp
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
Example:
Gets the fraction and the exponent of a double precision floating-point
number.
<math.h>
double frexp (double x, int *exp);
x
exp pointer to a stored integer exponent
Returns the fraction, exp points to the exponent. If x is 0, the function
returns 0 for both the fraction and exponent.
The absolute value of the fraction is in the range of 1/2 (inclusive) to 1
(exclusive). No domain or range error will occur.
#include <math.h>
#include <stdio.h> /* for printf */
int main(void)
{
}
Output:
For frexp of 50.000000
For frexp of -2.500000
For frexp of 0.000000
double x,y;
int n;
x = 50.0;
y = frexp (x, &n);
printf("For frexp of %f\n the fraction is %f\n ",
printf("
x = -2.5;
y = frexp (x, &n);
printf("For frexp of %f\n the fraction is %f\n ",
printf("
x = 0.0;
y = frexp (x, &n);
printf("For frexp of %f\n the fraction is %f\n ",
printf("
the fraction is 0.781250
the fraction is -0.625000
the fraction is 0.000000
and the exponent is 6
and the exponent is 2
and the exponent is 0
floating-point value for which to return the fraction and exponent
x, y);
x, y);
x, y);
and the exponent is %d\n\n", n);
and the exponent is %d\n\n", n);
and the exponent is %d\n\n", n);
/* for frexp
*/
DS51456E-page 167

Related parts for SW006014