Scroll to navigation

_Maxof(3) Library Functions Manual _Maxof(3)

NAME

_Maxof, _Minof - limits of an integer type

LIBRARY

Standard C library (libc)

SYNOPSIS

T _Maxof(typename T);
T _Minof(typename T);

DESCRIPTION

These operators return the maximum or minimum representable value of the operand integer type.

If the operand is not an integer type, it produces a compilation error.

RETURN VALUE

The maximum or minimum representable value of the operand integer type.

The result is an integer constant expression of the same type as the operand.

STANDARDS

GNU.

HISTORY

gcc 16.

EXAMPLES

#include <assert.h>
#include <limits.h>
#include <stdlib.h>
int
main(void)
{
	static_assert(_Maxof(long) == LONG_MAX);
	exit(EXIT_SUCCESS);
}

SEE ALSO

operator(7)

2025-12-01 Linux man-pages (unreleased)