modf
7-42
Signed Integer and Fraction
modf
Syntax
#include <math.h>
double
modf
(double value, double *iptr);
Defined in
modf.c in rts.src
Description
The modf function breaks a value into a signed integer and a signed fraction.
Each of the two parts has the same sign as the input argument. The function
returns the fractional part of the value and stores the integer part as a double
at the object pointed to by iptr.
Example
double value, ipart, fpart;
value = −3.1415;
fpart = modf(value, &ipart);
/* After execution, ipart contains −3.0, */
/* and fpart contains −0.1415. */
Raise to a Power
pow
Syntax
#include <math.h>
double
pow
(double x, double y);
Defined in
pow.c in rts.src
Description
The pow function returns x raised to the power y. A domain error occurs if x
=
0 and y
≤
0, or if x is negative and y is not an integer. A range error occurs if
the result is too large to represent.
Example
double x, y, z;
x = 2.0;
y = 3.0;
z = pow(x, y);
/* return value = 8.0 */
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...