ltoa
7-37
Run-Time-Support Functions
Natural Logarithm
log
Syntax
#include <math.h>
double
log
(double x);
Defined in
log.c in rts.src
Description
The log function returns the natural logarithm of a real number x. A domain er-
ror occurs if x is negative; a range error occurs if x is 0.
Example
float x, y;
x = 2.718282;
y = log(x);
/* Return value = 1.0 */
Common Logarithm
log10
Syntax
#include <math.h>
double
log10
(double x);
Defined in
log10.c in rts.src
Description
The log10 function returns the base-10 logarithm of a real number x. A domain
error occurs if x is negative; a range error occurs if x is 0.
Example
float x, y;
x = 10.0;
y = log(x);
/* Return value = 1.0 */
See setjmp/longjmp on page 7-45
longjump
Convert Long Integer to ASCII
ltoa
Syntax
#include <stdlib.h>
int
ltoa
(long val, char *buffer);
Defined in
ltoa.c in rts.src
Description
The ltoa function converts a long integer val to the equivalent ASCII string and
writes it into buffer. If the input number val is negative, a leading minus sign
is output. The ltoa function returns the number of characters placed in the
buffer.
Example
int i;
char s[10];
i =
ltoa
(−92993L, s); /* i = 6, s = ”−92993”*/
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...