Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ abs(3C) — HP-UX ANSI C A.09.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

floor(3M)

abs(3C)

NAME

abs(), labs() − return integer absolute value

SYNOPSIS

#include <stdlib.h>

int abs(int i);

long int labs(long int i);

DESCRIPTION

abs() returns the absolute value of its integer operand. 

labs() is similar to abs(), except that the argument and the returned value each have type long int. 

The largest negative integer returns itself. 

WARNINGS

In two’s-complement representation, the absolute value of the negative integer with largest magnitude is undefined.  Some implementations trap this error, but others simply ignore it. 

SEE ALSO

floor(3M). 

STANDARDS CONFORMANCE

abs(): AES, SVID2, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C

labs(): AES, XPG4, ANSI C

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026