Limits of Basic Types

Limits of Basic Types — portable method of determining the limits of the standard types

Synopsis


#include <glib.h>

#define             G_MININT8
#define             G_MAXINT8
#define             G_MAXUINT8

#define             G_MININT16
#define             G_MAXINT16
#define             G_MAXUINT16

#define             G_MININT32
#define             G_MAXINT32
#define             G_MAXUINT32

#define             G_MININT64
#define             G_MAXINT64
#define             G_MAXUINT64

Description

These macros provide a portable method to determine the limits of some of the standard integer and floating point types.

Details

G_MININT8

#define G_MININT8	((gint8)  0x80)

The minimum value which can be held in a gint8.

Since 2.4


G_MAXINT8

#define G_MAXINT8	((gint8)  0x7f)

The maximum value which can be held in a gint8.

Since 2.4


G_MAXUINT8

#define G_MAXUINT8	((guint8) 0xff)

The maximum value which can be held in a guint8.

Since 2.4


G_MININT16

#define G_MININT16	((gint16)  0x8000)

The minimum value which can be held in a gint16.

Since 2.4


G_MAXINT16

#define G_MAXINT16	((gint16)  0x7fff)

The maximum value which can be held in a gint16.

Since 2.4


G_MAXUINT16

#define G_MAXUINT16	((guint16) 0xffff)

The maximum value which can be held in a guint16.

Since 2.4


G_MININT32

#define G_MININT32	((gint32)  0x80000000)

The minimum value which can be held in a gint32.

Since 2.4


G_MAXINT32

#define G_MAXINT32	((gint32)  0x7fffffff)

The maximum value which can be held in a gint32.

Since 2.4


G_MAXUINT32

#define G_MAXUINT32	((guint32) 0xffffffff)

The maximum value which can be held in a guint32.

Since 2.4


G_MININT64

#define G_MININT64	((gint64) G_GINT64_CONSTANT(0x8000000000000000))

The minimum value which can be held in a gint64.


G_MAXINT64

#define G_MAXINT64	G_GINT64_CONSTANT(0x7fffffffffffffff)

The maximum value which can be held in a gint64.


G_MAXUINT64

#define G_MAXUINT64	G_GINT64_CONSTANT(0xffffffffffffffffU)

The maximum value which can be held in a guint64.