A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/cstdlib/llabs/ below:

function

<cstdlib>

llabs
long long int llabs (long long int n);

Absolute value

Returns the absolute value of parameter n ( /n/ ).

This is the long long int version of abs.



Parameters
n
Integral value.

Return Value The absolute value of n.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
/* llabs example */
#include <stdio.h>      /* printf */
#include <stdlib.h>     /* llabs */

int main ()
{
  long long int n,m;
  n=llabs(31558149LL);
  m=llabs(-100000000LL);
  printf ("n=%lld\n",n);
  printf ("m=%lld\n",m);
  return 0;
}

Output:


Data races Concurrently calling this function is safe, causing no data races.

Exceptions (C++)No-throw guarantee: this function throws no exceptions.

If the result cannot be represented as a long long int (such as llabs(LLONG_MIN) in an implementation with two's complement signed values), it causes undefined behavior.



See also
abs
Absolute value (function)
labs
Absolute value (function)
fabs
Compute absolute value (function)
ldiv
Integral division (function)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4