abs(3)

abs3

Integer absolute value function

Usage

#include <stdlib.h>

int

abs(int i);

Library

Standard C Library (libc, -lc)

Overview

The abs() function computes the absolute value of the integer i.

Return values

The abs() function returns the absolute value.

Releases

163 releases since Mac OS X 10.0; the text changed 4 times.

  1. 10.0–10.1.5
  2. 10.2–10.2.8
  3. 10.3–10.4.11
  4. 10.5–10.6.8
  5. 10.7–26.5

Standards

The abs() function conforms to ISO/IEC 9899:1999 (“ISO C99”).

Bugs

The absolute value of the most negative integer remains negative.

From Libc 1752.120.2 in macOS 26.5. Parsed by carta from the page's mdoc source.