Forum Discussion
2 Replies
- Altera_Forum
Honored Contributor
It should be there, as a part of newlib. Try including stdlib.h and see if that works.
Here's a brief description from a website I found:
- slackerSynopsis # include <stdlib.h> int abs(int i); Description abs returns the absolute value of i (also called the magnitude of i). That is, if i is negative, the result is the opposite of i, but if i is nonnegative the result is i. The similar function labs uses and returns long rather than int values. Returns The result is a nonnegative integer. Portability abs is ANSI. No supporting OS subroutines are required. - Altera_Forum
Honored Contributor
That's OK.
abs() is working now when i add <stdlib.h> . THX!