_Maxof(3)
π _Maxof(3) β the limits of an integer type, bestie
Okay so real talk: this is a page from section 3 of the manual, all about _Maxof and _Minof. It's giving "tiny page, huge power." Let's get into it. π¦
β¨ NAME β¨
_Maxof, _Minof β limits of an integer type
π LIBRARY π
The Standard C library (libc). Yeah, that libc. She's everywhere. π
πΈ SYNOPSIS πΈ
T _Maxof(typename T);
T _Minof(typename T);
π DESCRIPTION π
These operators hand you back the maximum or the minimum representable value of the operand integer type. That's it. That's the whole vibe. Simple, iconic, no notes. π
And if the operand is not an integer type? Not a warning, not a little shrug β it produces a compilation error. The compiler said "absolutely not" and meant it. π«
π«Ά 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. So like, type-accurate AND constant-expression-coded. She's doing both. Multi-talented. β¨
π STANDARDS π
GNU.
π°οΈ HISTORY π°οΈ
gcc 16. A modern queen. Fresh off the press. π
π EXAMPLES π
Bestie, here's the whole thing, copy it exactly:
#include <assert.h>
#include <limits.h>
#include <stdlib.h>
int
main(void)
{
static_assert(_Maxof(long) == LONG_MAX);
exit(EXIT_SUCCESS);
}
Look at that static_assert just casually confirming the truth at compile time. Compile-time self-care. π
π SEE ALSO π
Lowkey important reminder: this page is from Linux man-pages 6.20, dated 2025-12-01. Go off, man-pages team. π«‘
That's the page, bestie. _Maxof, _Minof, done, dusted, compiled. Periodt. πππ
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms