What is the difference between functions abs() and fabs()?

2 years ago
C Programming

These 2 functions basically perform the same action, which is to get the absolute value of the given value. Abs() is used for integer values, while fabs() is used for floating type numbers. Also, the prototype for abs() is under <stdlib.h>, while fabs() is under <math.h>.

0
Sanisha Maharjan
Jan 20, 2022
More related questions

Questions Bank

View all Questions