Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
llabs.c File Reference
#include <stdlib.h>
Include dependency graph for llabs.c:

Go to the source code of this file.

Functions

long long llabs (long long j)
 Computes the absolute value of an long long number. More...
 

Function Documentation

◆ llabs()

long long llabs ( long long  n)

Computes the absolute value of an long long number.

Computes the absolute value of an long long number. The behavior is undefined if the result cannot be represented by the return type.

Parameters
nlong long value
Returns
The absolute value of n (i.e. |n|), if it is representable.

Definition at line 29 of file llabs.c.

30 {
31  return (j < 0 ? -j : j);
32 }