Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ labs(3) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought



LABS(3,L)                   AIX Technical Reference                   LABS(3,L)



-------------------------------------------------------------------------------
labs



PURPOSE

Returns the absolute value of long integers.

LIBRARY

Standard C Library (libc.a)

SYNTAX

long labs (n);
long n;

DESCRIPTION

The labs function produces the absolute value of its long integer argument n.
There is no error-return value.  The result is undefined when the argument is
the least of the negative long integers (for example, -2147483648 on OS/2),
whose absolute value cannot be represented as a long integer.  The value of the
minimum allowable integer is stored in "LONG_MIN" in the limits.h include file.

EXAMPLE

This example computes "y" as the absolute value of the long integer -41567.

  #include <stdlib.h>

  long x, y;

  x = -41567L;
  y = labs (x);   /* y = 41567L */



















Processed November 7, 1990         LABS(3,L)                                  1



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