---
name: "ggidev-dec_3"
section: "3"
platform: "linux"
package: "libggi2-dev"
version: "1:2.2.2-5"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/ggidev-inc_3"
---

# ggidev-dec\_3(3)

Unary arithmetic triple-int operations

Part of [ggidev-inc\_3(3)](/ggidev-inc_3/3.md).

## NAME

**ggidev-inc\_3**, **ggidev-dec\_3**, **ggidev-negate\_3**, **ggidev-abs\_3** - Unary arithmetic triple-int operations

## SYNOPSIS

```
#include <ggi/internal/triple-int.h>
unsigned *inc_3(unsigned x[3]);
unsigned *dec_3(unsigned x[3]);
unsigned *negate_3(unsigned x[3]);
unsigned *abs_3(unsigned x[3]);
```

## DESCRIPTION

**inc\_3** increments **x** by one. Equivalent to ++x.

**dec\_3** decrements **x** by one. Equivalent to --x.

**negate\_3** negates **x**. Equivalent to x=-x.

**abs\_3** takes the absolute value of **x**. Equivalent to x=x\<0?-x:x.

## RETURN VALUE

**inc\_3**, **dec\_3**, **negate\_3** and **abs\_3** all return a pointer to **x** which has been updated in place.

## EXAMPLES

Some unary arithmetic operations on **triple-ints**:

```
unsigned x[3];
assign_int_3(x, 44);
negate_3(x);  /* x is now -44 */
inc_3(x);     /* x is now -43 */
abs_3(x);     /* x is now 43 */
dec_3(x);     /* x is now 42 */
```

## SEE ALSO

`ggidev-triple-int(7)`, `ggidev-assign_int_3(3)`
