
floor
7-32
Floor
floor
Syntax
#include <math.h>
double
floor
(double x);
Defined in
floor.c in rts.src
Description
The floor function returns a floating-point number that represents the largest
integer less than or equal to x. The floor function is expanded inline if the
−
x
option is used.
Example
double answer;
answer = floor(3.1415);
/* answer = 3.0 */
answer = floor(−3.5);
/* answer = −4.0 */
Floating-Point Remainder
fmod
Syntax
#include <math.h>
double
fmod
(double x, double y);
Defined in
fmod.c in rts.src
Description
The fmod function returns the exact floating-point remainder of x divided by y.
If y==0, the function returns 0.
Example
double x, y, r;
x = 11.0;
y = 5.0;
r = fmod(x, y);
/* fmod returns 1.0 */
Deallocate Memory
free
Syntax
#include <stdlib.h>
void
free
(void *packet);
Defined in
memory.c in rts.src
Description
The free function deallocates memory space (pointed to by packet) that was
previously allocated by a malloc, calloc, or realloc call. This makes the memory
space available again. If you attempt to free unallocated space, the function
takes no action and returns. For more information, see section 6.1.4,
Dynamic
Memory Allocation
Example
This example allocates ten bytes and then frees them.
char *x;
x = malloc(10);
/* allocate 10 bytes */
free(x);
/* free 10 bytes */
Содержание TMS320C2x
Страница 8: ...viii...
Страница 69: ...2 47 C Compiler Description...
Страница 159: ...6 36...
Страница 226: ...8 6...
Страница 250: ...Index Index 14 Z z shell option 2 2 2 4 2 14 overriding with c option 4 5 overriding with n option 2 13...