SW006014 Microchip Technology, SW006014 Datasheet - Page 172

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
DS51456E-page 168
frexpf
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
Example:
Gets the fraction and the exponent of a single precision floating-point
number.
<math.h>
float frexpf (float 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 frexpf of 0.150000
For frexpf of -2.500000
For frexpf of 0.000000
printf("For frexpf of %f\n
printf("For frexpf of %f\n
printf("For frexpf of %f\n
float x,y;
int n;
x = 0.15F;
y = frexpf (x, &n);
printf("
x = -2.5F;
y = frexpf (x, &n);
printf("
x = 0.0F;
y = frexpf (x, &n);
printf("
the fraction is 0.600000
the fraction is -0.625000
the fraction is 0.000000
and the exponent is -2
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 frexpf */
the fraction is %f\n ",
the fraction is %f\n ",
the fraction is %f\n ",
© 2008 Microchip Technology Inc.

Related parts for SW006014