SW006014 Microchip Technology, SW006014 Datasheet - Page 165

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.
fabs
Description:
Include:
Prototype:
Argument:
Return Value:
Remarks:
Example:
fabsf
Description:
Include:
Prototype:
Argument:
Return Value:
Remarks:
Example:
Calculates the absolute value of a double precision floating-point value.
<math.h>
double fabs(double x);
x
Returns the absolute value of x. (A negative number is returned as
positive, a positive number is unchanged.)
No domain or range error will occur.
#include <math.h>
#include <stdio.h> /* for printf */
int main(void)
{
}
Output:
The absolute value of
The absolute value of -1.500000 is
Calculates the absolute value of a single precision floating-point value.
<math.h>
float fabsf(float x);
x
Returns the absolute value of x. (A negative number is returned as
positive, a positive number is unchanged.)
No domain or range error will occur.
#include <math.h>
#include <stdio.h> /* for printf */
int main(void)
{
}
Output:
The absolute value of
The absolute value of -1.500000 is
printf("The absolute value of
printf("The absolute value of
double x, y;
x = 1.75;
y = fabs (x);
x = -1.5;
y = fabs (x);
printf("The absolute value of %f is
float x,y;
x = 1.75F;
y = fabsf (x);
x = -1.5F;
y = fabsf (x);
printf("The absolute value of %f is
floating-point value for which to return the absolute value
floating-point value for which to return the absolute value
/* for fabs
/* for fabsf
1.750000 is
1.750000 is
%f is
%f is
*/
*/
1.750000
1.500000
1.750000
1.500000
%f\n", x, y);
%f\n", x, y);
DS51456E-page 161
%f\n", x, y);
%f\n", x, y);

Related parts for SW006014