labs


Obtain absolute value (long type)

[Classification]

Standard library

[Syntax]

#include <stdlib.h>

long int __far labs(long int j);

[Return value]

Returns the absolute value of j (size of j), | j |. If the input value of labs is the smallest negative value, the same value is returned.

[Description]

This function obtains the absolute value of j (size of j), | j |. If j is a negative number, the result is the reversal of j. If j is not negative, the result is j. This function is the same as abs, but uses long type instead of int type, and the return value is also of long type.