abs(3)


NAME

   abs, labs, llabs, imaxabs - compute the absolute value of an integer

SYNOPSIS

   #include <stdlib.h>

   int abs(int j);
   long int labs(long int j);
   long long int llabs(long long int j);

   #include <inttypes.h>

   intmax_t imaxabs(intmax_t j);

   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):

   llabs():
       _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L

DESCRIPTION

   The  abs() function computes the absolute value of the integer argument
   j.  The labs(), llabs() and imaxabs() functions  compute  the  absolute
   value  of  the  argument  j  of  the  appropriate  integer type for the
   function.

RETURN VALUE

   Returns the absolute value of the integer argument, of the  appropriate
   integer type for the function.

ATTRIBUTES

   For   an   explanation   of   the  terms  used  in  this  section,  see
   attributes(7).

   
   Interface           Attribute      Value   
   
   abs(), labs(),      Thread safety  MT-Safe 
   llabs(), imaxabs()                         
   

CONFORMING TO

   POSIX.1-2001,  POSIX.1-2008,  C99, SVr4, 4.3BSD.  C89 only includes the
   abs() and labs() functions; the functions llabs()  and  imaxabs()  were
   added in C99.

NOTES

   Trying  to  take the absolute value of the most negative integer is not
   defined.

   The llabs() function is included  in  glibc  since  version  2.0.   The
   imaxabs() function is included in glibc since version 2.1.1.

   For   llabs()   to   be   declared,  it  may  be  necessary  to  define
   _ISOC99_SOURCE or _ISOC9X_SOURCE (depending on the  version  of  glibc)
   before including any standard headers.

   By  default, GCC handles abs(), labs(), and (since GCC 3.0) llabs() and
   imaxabs() as built-in functions.

SEE ALSO

   cabs(3), ceil(3), fabs(3), floor(3), rint(3)

COLOPHON

   This page is part of release 4.09 of the Linux  man-pages  project.   A
   description  of  the project, information about reporting bugs, and the
   latest    version    of    this    page,    can     be     found     at
   https://www.kernel.org/doc/man-pages/.


More Linux Commands

manpages/msgop.2.html
msgop(2) - message operations (System - Linux man page).....
The msgsnd() and msgrcv() system calls are used, respectively, to send messages to, and receive messages from, a System V message queue. The calling process mus

manpages/setlocale.3.html
setlocale(3) - set the current locale - Linux manual page...
The setlocale() function is used to set or query the programs current locale. If locale is not NULL, the programs current locale is modified according to the ar

manpages/lftp.conf.5.html
lftp.conf(5) the global configuration file for lftp.........
the /etc/lftp.conf configuration file changes the default behavior of lftp and affects the settings for all users. User-specific options should be set in either

manpages/XIconSize.3.html
XIconSize(3) - allocate icon size structure and set or read
The XAllocIconSize function allocates and returns a pointer to a XIconSize structure. Note that all fields in the XIconSize structure are initially set to zero.

manpages/cp.1.html
cp(1) - copy files and directories - Linux manual page......
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. Mandatory arguments to long options are mandatory for short options too. -a, --archive same as -dR --pr

manpages/B::Xref.3pm.html
B::Xref(3pm) - Generates cross reference reports for Perl pr
The B::Xref module is used to generate a cross reference listing of all definitions and uses of variables, subroutines and formats in a Perl program. It is impl

manpages/glutDestroyWindow.3.html
glutDestroyWindow(3) - destroys the specified window........
glutDestroyWindow destroys the window specified by win and the windows associated OpenGL context, logical colormap (if the window is color index), and overlay a

manpages/mupdatetest.1.html
mupdatetest(1) - interactive MUPDATE test program (ManPage)
mupdatetest is a utility that allows you to authenticate to a MUPDATE server and interactively issue commands to it. Once authenticated you may issue any MUPDAT

manpages/XChangeDeviceControl.3.html
XChangeDeviceControl(3) - query and change input device cont
These requests are provided to manipulate those input devices that support device control. A BadMatch error will be generated if the requested device does not s

manpages/rtmon.8.html
rtmon(8) - listens to and monitors RTnetlink (Man Page).....
This manual page documents briefly the rtmon command. rtmon listens on netlink socket and monitors routing table changes. rtmon can be started before the first

manpages/git-mktag.1.html
git-mktag(1) - Creates a tag object - Linux manual page.....
Reads a tag contents on standard input and creates a tag object that can also be used to sign other objects. The output is the new tags &lt;object&gt; identifier. TAG

manpages/filename.n.html
filename(n) - File name conventions supported by Tcl command
All Tcl commands and C procedures that take file names as arguments expect the file names to be in one of three forms, depending on the current platform. On eac





We can't live, work or learn in freedom unless the software we use is free.