Download avr-libc Reference Manual

Transcript
5.7
General utilities
If flags has the DTOSTRE PLUS SIGN bit set, a plus sign will be used instead of a
space character in this case.
5.7.4.8
char∗ dtostrf (double val, char width, char prec, char ∗ s)
The dtostrf() function converts the double value passed in val into an ASCII representationthat will be stored under s. The caller is responsible for providing sufficient
storage in s.
Conversion is done into in the style [-]d.ddd. The minimum field width of the output
string (including the “.” and the possible sign for negative values) is given in width,
and prec determines the number of digits after the decimal sign.
5.7.4.9
void exit (int status)
The exit() function terminates the application. Since there is no environment to return to, status is ignored, and code execution will eventually reach an infinite loop,
thereby effectively halting all code processing.
In a C++ context, global destructors will be called before halting execution.
5.7.4.10
void free (void ∗ ptr)
The free() function causes the allocated memory referenced by ptr to be made available for future allocations. If ptr is NULL, no action occurs.
5.7.4.11
char∗ itoa (int val, char ∗ s, int radix)
The function itoa() converts the integer value from val into an ASCII representation
that will be stored under s. The caller is responsible for providing sufficient storage in
s.
Conversion is done using the radix as base, which may be a number between 2
(binary conversion) and up to 36. If radix is greater than 10, the next digit after
“9” will be the letter “a”.
The itoa() function returns the pointer passed as s.
5.7.4.12 long labs (long i)
The labs() function computes the absolute value of the long integer i.
Note:
The abs() and labs() functions are builtins of gcc.
Generated on Tue Sep 10 09:24:23 2002 for avr-libc by Doxygen
17