SW006013 Microchip Technology, SW006013 Datasheet - Page 171

MPLAB C Compiler For DsPIC DSCs

SW006013

Manufacturer Part Number
SW006013
Description
MPLAB C Compiler For DsPIC DSCs
Manufacturer
Microchip Technology
Series
DsPIC30F/33Fr
Type
MPLAB® C Compilerr
Datasheet

Specifications of SW006013

Supported Families
DsPIC30F, DsPIC33F
Core Architecture
DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
DsPIC30F And DsPIC33F
Tool Function
Compiler
Tool Type
Compiler
Processor Series
dsPIC
Lead Free Status / RoHS Status
na
For Use With/related Products
dSPIC DSCs
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 SW006013