fabs()

Returns the absolute value of the floating point argument.

Syntax

Loading...

Example 1

Use fabs() to return the absolute value of -6.5:

Loading...
Interested in helping build Docs? Read the Contribution Guide or share your feedback.

Learn C++ on Codecademy