labs

De RAD Studio
Aller à : navigation, rechercher

Remonter à Stdlib.h - Index


Header File

stdlib.h

Category

Math Routines

Prototype

long labs(long int x);

Description

Gives long absolute value.

labs computes the absolute value of the parameter x.

Return Value

labs returns the absolute value of x.

Example



 #include <stdio.h>
 #include <math.h>
 int main(void)
 {
    long result;
    long x = -12345678L;
    result= labs(x);
    printf("number: %ld abs value: %ld\n", x, result);
    return 0;
 }



Portability



POSIX Win32 ANSI C ANSI C++

+

+

+

+