---
name: "imaxabs"
section: "3"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/abs"
---

# imaxabs(3)

compute the absolute value of an integer

Part of [abs(3)](/abs/3.md).

## NAME

abs, labs, llabs, imaxabs, uabs, ulabs, ullabs, umaxabs - compute the absolute value of an integer

## LIBRARY

Standard C library (*libc*, *-lc*)

## SYNOPSIS

```
#include <stdlib.h>
```

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

**unsigned int uabs(int** *j***);** **unsigned long ulabs(long** *j***);** **unsigned long long ullabs(long long** *j***);**

**#include \<inttypes.h\>**

**intmax\_t imaxabs(intmax\_t** *j***);** **uintmax\_t umaxabs(intmax\_t** *j***);**

Feature Test Macro Requirements for glibc (see [**feature\_test\_macros**(7)](/feature_test_macros/7.md)):

**llabs**():

```
    _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
```

**uabs**(), **ulabs**(), **ullabs**(), **umaxabs**():

```
    _ISOC2Y_SOURCE
```

## DESCRIPTION

These 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)](/attributes/7.md).

| | | |
| --- | --- | --- |
| **Interface** | **Attribute** | **Value** |
| **abs**(), **labs**(), **llabs**(), **imaxabs**(), **uabs**(), **ulabs**(), **ullabs**(), **umaxabs**() | Thread safety | MT-Safe |

## STANDARDS

- **abs**() **labs**() **llabs**() **imaxabs**()

  C23, POSIX.1-2024

## HISTORY

- **abs**()

  C89, POSIX.1-1996, SVr4, 4.3BSD.

- **labs**()

  C89, POSIX.1-2001.

- **llabs**()

  C99, POSIX.1-2001; glibc 2.0.

- **imaxabs**()

  C99, POSIX.1-2001; glibc 2.1.1.

- **uabs**() **ulabs**() **ullabs**()

  C2y; glibc 2.42.

- **umaxabs**()

  C2y; glibc 2.43.

## BUGS

For **abs**(), **labs**(), **llabs**(), and **imaxabs**(), trying to take the absolute value of the most negative integer is not defined.

## SEE ALSO

[**cabs**(3)](/cabs/3.md), [**ceil**(3)](/ceil/3.md), [**fabs**(3)](/fabs/3.md), [**floor**(3)](/floor/3.md), [**rint**(3)](/rint/3.md)
