fabs

 

Description

Absolute value of a floating-point (double).

Syntax

double fabs( double x )

Parameters

x
[input] value whose absolute value is returned

Return

Return the absolute value of x.

Examples

EX1

void    fabs_ex1()
{
    double        x = -5.9;
    double        val = fabs(x);
    
    printf("fabs(%f) = %f\n", x, val);
}

Remark

See Also

abs

header to Include

origin.h

Reference