fabs() Calculate Absolute Value of Floating-Point Value
#include <math.h>
double fabs(x);
double x; Floating-point value
fabs() returns the absolute value of the double 'x'.
Returns: The absolute value of 'x'. There is no error return.
-------------------------------- Example ---------------------------------
The following statements calculate the absolute values of -15.7, 0.0
and 4.66e-3.
#include <math.h> /* Required for declaration only */
main()
{
double x, y, z;
x = fabs(-15.7); /* x = 15.7 */
y = fabs(0.0); /* y = 0.0 */
z = fabs(4.66e-3); /* z = 4.66e-3 (0.00466) */
}
Seealso:
This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster