abs(), labs(), llabs(), imaxabs()

return absolute value of an integer 

Function


SYNOPSIS

#include <stdlib.h>

int abs(int val);

long labs(long val);

long long labs(long long val);

#include <inttypes.h>

intmax_t labs(intmax_t val);


DESCRIPTION

The abs() class of functions return the absolute value of their integer operands, val, returning teh same tyoe. If the result cannot be represented, the behavior is undefined.


RETURN VALUES

The abs() class of functions return the absolute value of val.


CONFORMANCE

abs() conforms to ANSI/ISO 9899:1990 'ISO C90' labs() conforms to ANSI/ISO 9899:1990 'ISO C90' llabs() conforms to ANSI/ISO 9899:1999 'ISO C99' imaxabs() conforms to ANSI/ISO 9899:1999 'ISO C99'

MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
fabs()


PTC MKS Toolkit 10.5 Documentation Build 40.