SW006013 Microchip Technology, SW006013 Datasheet - Page 189

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.
sqrtf
Description:
Include:
Prototype:
Argument:
Return Value:
Remarks:
Example:
Calculates the square root of a single precision floating-point value.
<math.h>
float sqrtf(float x);
x
Returns the non-negative square root of x.
If x is negative, a domain error occurs.
#include <math.h>
#include <stdio.h> /* for printf, perror */
#include <errno.h> /* for errno
int main(void)
{
}
Output:
The square root of 0.0F is 0.000000
The square root of 9.5F is 3.082207
Error: domain error
The square root of -25F is nan
double x;
errno = 0;
x = sqrtf (0.0F);
if (errno)
printf("The square root of 0.0F is %f\n\n", x);
errno = 0;
x = sqrtf (9.5F);
if (errno)
printf("The square root of 9.5F is %f\n\n", x);
errno = 0;
x = sqrtf (-25.0F);
if (errno)
printf("The square root of -25F is %f\n", x);
perror("Error");
perror("Error");
perror("Error");
non-negative floating-point value
/* for sqrtf
DS51456E-page 185
*/
*/

Related parts for SW006013