These functions are provided for obtaining the absolute value (or
magnitude) of a number. The absolute value of a real number
x is x is x is positive, -x if x is
negative. For a complex number z, whose real part is x and
whose imaginary part is y, the absolute value is
(x*x + y*y).
labs are in `stdlib.h';
cabs are declared in `math.h'.
Most computers use a two's complement integer representation, in which
the absolute value of
INT_MIN (the smallest possible
cannot be represented; thus,
abs (INT_MIN) is not defined.
abs, except that both the argument and result are of type
long intrather than
cabsfunction returns the absolute value of the complex number z, whose real part is
z.realand whose imaginary part is
z.imag. (See also the function
hypotin section Exponentiation and Logarithms.) The value is:
sqrt (z.real*z.real + z.imag*z.imag)
Go to the first, previous, next, last section, table of contents.