---
name: "ZT_CMP_INT"
section: "3"
platform: "linux"
package: "libzt-doc"
version: "0.3.1-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ZT_CMP_INT"
---

# ZT\_CMP\_INT(3)

construct a claim of a relation between two integers

## NAME

**ZT\_CMP\_INT**, **zt\_cmp\_int** – construct a claim of a relation between two integers

## SYNOPSIS

**#include \<zt.h\>**

```
#define ZT_CMP_INT(left, rel, right) \
  zt_cmp_int( \
    ZT_CURRENT_LOCATION(), \
    zt_pack_integer((left), (#left)), \
    zt_pack_string((#rel), (#rel)), \
    zt_pack_integer((right), (#right)))
```

*zt\_claim*\

**zt\_cmp\_int**(*zt\_location location*, *zt\_value left*, *zt\_value rel*, *zt\_value right*);

## DESCRIPTION

**zt\_cmp\_int**() constructs a claim of a relation between two integers. It should be used through the macro **ZT\_CMP\_INT**() which passes source code location and packs arguments.

The relation must be one of *==*, *!=*, *\<*, *\<=*, *\>* or *\>=*.

## IMPLEMENTATION NOTES

**ZT\_CMP\_INT**() evaluates *left* and *right* exactly once.

## RETURN VALUES

Both the macro and the function return a claim structure with the right attributes set. The returned claim is usually passed to **zt\_check**() or to **zt\_assert**().

## SEE ALSO

[ZT\_CMP\_BOOL(3)](/ZT_CMP_BOOL/3.md), [ZT\_CMP\_RUNE(3)](/ZT_CMP_RUNE/3.md), ZT\_CMP\_CSTR(3), [ZT\_CMP\_PTR(3)](/ZT_CMP_PTR/3.md), [ZT\_CMP\_UINT(3)](/ZT_CMP_UINT/3.md), [ZT\_FALSE(3)](/ZT_FALSE/3.md), [ZT\_NOT\_NULL(3)](/ZT_NOT_NULL/3.md), [ZT\_NULL(3)](/ZT_NULL/3.md), [ZT\_TRUE(3)](/ZT_TRUE/3.md), [zt\_check(3)](/zt_check/3.md),

## HISTORY

The **ZT\_CMP\_INT**() macro and the **zt\_cmp\_int**() function first appeared in libzt 0.1

Since libzt 0.3 **zt\_cmp\_int**() internally promotes **left** and **right** arguments from **ZT\_INTEGER** to **ZT\_INTMAX**.

## AUTHORS

Zygmunt Krynicki ⟨*me@zygoon.pl*⟩
