Skip to content

Nat

Functions for converting between nat values and ordinary integer representations of non-negative integers.


pack

Convert an int32 value into a natural number.

Interpret the given integer as a natural number and return the corresponding nat value. If the input is negative, the function will return Zero.

pack : int32 -> natpack : int32 -> nat

unpack

Convert a natural number into an int32 value.

Return the integer representation of the given value as an int32.

unpack : nat -> int32unpack : nat -> int32