logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

intmax_t, uintmax_t - greatest-width basic integer types

Bugs

       These types may not be as large as extended integer types, such as __int128

Description

intmax_t  is  a  signed  integer  type capable of representing any value of any basic signed integer type
       supported by the implementation.  It is capable of storing values in the range [INTMAX_MIN, INTMAX_MAX].

       uintmax_t is an unsigned integer type capable of representing any value of  any  basic  unsigned  integer
       type supported by the implementation.  It is capable of storing values in the range [0, UINTMAX_MAX].

       The macros [U]INTMAX_WIDTH expand to the width in bits of these types.

       The macros [U]INTMAX_MAX expand to the maximum value that these types can hold.

       The macro INTMAX_MIN expands to the minimum value that intmax_t can hold.

       The macros [U]INTMAX_C() expand their argument to an integer constant of type [u]intmax_t.

       The  length  modifier  for  [u]intmax_t  for  the  printf(3) and the scanf(3) families of functions is j;
       resulting commonly in %jd, %ji, %ju, or %jx for printing [u]intmax_t values.

History

       C99, POSIX.1-2001.

Library

       Standard C library (libc)

Name

       intmax_t, uintmax_t - greatest-width basic integer types

Notes

       The following header also provides these types: <inttypes.h>.

See Also

int64_t(3type), intptr_t(3type), printf(3), strtoimax(3)

Linux man-pages 6.9.1                              2024-05-02                                    intmax_t(3type)

Standards

       C11, POSIX.1-2008.

Synopsis

#include<stdint.h>typedef /* ... */ intmax_t;typedef /* ... */ uintmax_t;#defineINTMAX_WIDTH  /* ... */
       #defineUINTMAX_WIDTHINTMAX_WIDTH#defineINTMAX_MAX    /*  2**(INTMAX_WIDTH - 1) - 1  */
       #defineINTMAX_MIN    /*  - 2**(INTMAX_WIDTH - 1)    */
       #defineUINTMAX_MAX   /*  2**UINTMAX_WIDTH - 1       */

       #defineINTMAX_C(c)c## /* ... */
       #defineUINTMAX_C(c)c## /* ... */

See Also