Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ labs(DOS) — OpenDesktop Software Development System 1.0.0d

Media Vault

Software Library

Restoration Projects

Artifacts Sought

     Name
          labs - Converts to absolute value.

     Syntax
          #include <stdlib.h>

          long labs(n)
          long n;

     Description
          The labs function produces the absolute value of its long-
          integer argument n.

     Return Value
          The labs function returns the absolute value of its
          argument. There is no error return.

     See Also
          abs(S), cabs(DOS), fabs(S)

     Example
          #include <stdlib.h> #include <stdio.h>

          main()
           {
                  long x,y;

                  x = -41567L;
                  y = labs(x);
                  printf("The labs(%ld) = %ld",x,y);
           }

          This program uses labs to get and display the absolute value
          of -41,567.

                                                (printed 6/18/89)



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