---
name: "ZT_CMP_UINT"
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_UINT"
---

# ZT\_CMP\_UINT(3)

construct a claim of a relation between two unsigned integers

## NAME

**ZT\_CMP\_UINT**, **zt\_cmp\_uint** – construct a claim of a relation between two unsigned integers

## SYNOPSIS

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

```
#define ZT_CMP_UINT(left, rel, right) \
  zt_cmp_uint( \
    ZT_CURRENT_LOCATION(), \
    zt_pack_unsigned((left), (#left)), \
    zt_pack_string((#rel), (#rel)), \
    zt_pack_unsigned((right), (#right)))
```

*zt\_claim*\

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

## DESCRIPTION

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

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

## IMPLEMENTATION NOTES

**ZT\_CMP\_UINT**() 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\_UINT**() macro and the **zt\_cmp\_uint**() function first appeared in libzt 0.1

Since libzt 0.3 **zt\_cmp\_uint**() internally promotes **left** and **right** arguments from **ZT\_UNSIGNED** to **ZT\_UINTMAX**.

## AUTHORS

Zygmunt Krynicki ⟨*me@zygoon.pl*⟩
