Guardian C Library Calls Reference Manual

Reference to Library Calls
Guardian TNS C Library Calls Reference Manual128833 3-33
fabs
fabs
The fabs function computes the absolute value of its floating-point argument.
expr
is an expression of type double.
Return Value
is the absolute value of expr, expressed as a double value.
Example
This example prints “The absolute value of -25.000000 is 25.000000.
#include <mathh>
#include <stdioh>
int main(void)
{
double x, r;
x = -25;
r = fabs(x);
printf("The absolute value of %f is %f.", x, r);
}
#include <mathh>
double fabs(double expr);