1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>Limits of Basic Types</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7 <link rel="home" href="index.html" title="GLib Reference Manual">
8 <link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals">
9 <link rel="prev" href="glib-Basic-Types.html" title="Basic Types">
10 <link rel="next" href="glib-Standard-Macros.html" title="Standard Macros">
11 <meta name="generator" content="GTK-Doc V1.13 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
13 <link rel="chapter" href="glib.html" title="GLib Overview">
14 <link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
15 <link rel="chapter" href="glib-core.html" title="GLib Core Application Support">
16 <link rel="chapter" href="glib-utilities.html" title="GLib Utilities">
17 <link rel="chapter" href="glib-data-types.html" title="GLib Data Types">
18 <link rel="chapter" href="tools.html" title="GLib Tools">
19 <link rel="index" href="api-index-full.html" title="Index">
20 <link rel="index" href="api-index-deprecated.html" title="Index of deprecated symbols">
21 <link rel="index" href="api-index-2-2.html" title="Index of new symbols in 2.2">
22 <link rel="index" href="api-index-2-4.html" title="Index of new symbols in 2.4">
23 <link rel="index" href="api-index-2-6.html" title="Index of new symbols in 2.6">
24 <link rel="index" href="api-index-2-8.html" title="Index of new symbols in 2.8">
25 <link rel="index" href="api-index-2-10.html" title="Index of new symbols in 2.10">
26 <link rel="index" href="api-index-2-12.html" title="Index of new symbols in 2.12">
27 <link rel="index" href="api-index-2-14.html" title="Index of new symbols in 2.14">
28 <link rel="index" href="api-index-2-16.html" title="Index of new symbols in 2.16">
29 <link rel="index" href="api-index-2-18.html" title="Index of new symbols in 2.18">
30 <link rel="index" href="api-index-2-20.html" title="Index of new symbols in 2.20">
31 <link rel="index" href="api-index-2-22.html" title="Index of new symbols in 2.22">
32 <link rel="index" href="api-index-2-24.html" title="Index of new symbols in 2.24">
34 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
35 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
37 <td><a accesskey="p" href="glib-Basic-Types.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
38 <td><a accesskey="u" href="glib-fundamentals.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
39 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
40 <th width="100%" align="center">GLib Reference Manual</th>
41 <td><a accesskey="n" href="glib-Standard-Macros.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
43 <tr><td colspan="5" class="shortcuts">
44 <a href="#glib-Limits-of-Basic-Types.synopsis" class="shortcut">Top</a>
46 <a href="#glib-Limits-of-Basic-Types.description" class="shortcut">Description</a>
49 <div class="refentry" title="Limits of Basic Types">
50 <a name="glib-Limits-of-Basic-Types"></a><div class="titlepage"></div>
51 <div class="refnamediv"><table width="100%"><tr>
53 <h2><span class="refentrytitle"><a name="glib-Limits-of-Basic-Types.top_of_page"></a>Limits of Basic Types</span></h2>
54 <p>Limits of Basic Types — portable method of determining the limits of the standard types</p>
56 <td valign="top" align="right"></td>
58 <div class="refsynopsisdiv" title="Synopsis">
59 <a name="glib-Limits-of-Basic-Types.synopsis"></a><h2>Synopsis</h2>
60 <pre class="synopsis">
61 #include <glib.h>
63 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT:CAPS" title="G_MININT">G_MININT</a>
64 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT:CAPS" title="G_MAXINT">G_MAXINT</a>
65 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT:CAPS" title="G_MAXUINT">G_MAXUINT</a>
67 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINSHORT:CAPS" title="G_MINSHORT">G_MINSHORT</a>
68 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXSHORT:CAPS" title="G_MAXSHORT">G_MAXSHORT</a>
69 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUSHORT:CAPS" title="G_MAXUSHORT">G_MAXUSHORT</a>
71 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINLONG:CAPS" title="G_MINLONG">G_MINLONG</a>
72 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXLONG:CAPS" title="G_MAXLONG">G_MAXLONG</a>
73 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXULONG:CAPS" title="G_MAXULONG">G_MAXULONG</a>
75 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT8:CAPS" title="G_MININT8">G_MININT8</a>
76 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT8:CAPS" title="G_MAXINT8">G_MAXINT8</a>
77 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT8:CAPS" title="G_MAXUINT8">G_MAXUINT8</a>
79 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT16:CAPS" title="G_MININT16">G_MININT16</a>
80 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT16:CAPS" title="G_MAXINT16">G_MAXINT16</a>
81 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT16:CAPS" title="G_MAXUINT16">G_MAXUINT16</a>
83 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT32:CAPS" title="G_MININT32">G_MININT32</a>
84 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT32:CAPS" title="G_MAXINT32">G_MAXINT32</a>
85 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT32:CAPS" title="G_MAXUINT32">G_MAXUINT32</a>
87 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MININT64:CAPS" title="G_MININT64">G_MININT64</a>
88 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXINT64:CAPS" title="G_MAXINT64">G_MAXINT64</a>
89 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXUINT64:CAPS" title="G_MAXUINT64">G_MAXUINT64</a>
91 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXSIZE:CAPS" title="G_MAXSIZE">G_MAXSIZE</a>
92 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINSSIZE:CAPS" title="G_MINSSIZE">G_MINSSIZE</a>
93 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXSSIZE:CAPS" title="G_MAXSSIZE">G_MAXSSIZE</a>
95 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINOFFSET:CAPS" title="G_MINOFFSET">G_MINOFFSET</a>
96 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXOFFSET:CAPS" title="G_MAXOFFSET">G_MAXOFFSET</a>
98 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINFLOAT:CAPS" title="G_MINFLOAT">G_MINFLOAT</a>
99 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXFLOAT:CAPS" title="G_MAXFLOAT">G_MAXFLOAT</a>
101 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MINDOUBLE:CAPS" title="G_MINDOUBLE">G_MINDOUBLE</a>
102 #define <a class="link" href="glib-Limits-of-Basic-Types.html#G-MAXDOUBLE:CAPS" title="G_MAXDOUBLE">G_MAXDOUBLE</a>
105 <div class="refsect1" title="Description">
106 <a name="glib-Limits-of-Basic-Types.description"></a><h2>Description</h2>
108 These macros provide a portable method to determine the limits of some of
109 the standard integer and floating point types.
112 <div class="refsect1" title="Details">
113 <a name="glib-Limits-of-Basic-Types.details"></a><h2>Details</h2>
114 <div class="refsect2" title="G_MININT">
115 <a name="G-MININT:CAPS"></a><h3>G_MININT</h3>
116 <pre class="programlisting">#define G_MININT INT_MIN
119 The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a>.
123 <div class="refsect2" title="G_MAXINT">
124 <a name="G-MAXINT:CAPS"></a><h3>G_MAXINT</h3>
125 <pre class="programlisting">#define G_MAXINT INT_MAX
128 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint" title="gint"><span class="type">gint</span></a>.
132 <div class="refsect2" title="G_MAXUINT">
133 <a name="G-MAXUINT:CAPS"></a><h3>G_MAXUINT</h3>
134 <pre class="programlisting">#define G_MAXUINT UINT_MAX
137 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint" title="guint"><span class="type">guint</span></a>.
141 <div class="refsect2" title="G_MINSHORT">
142 <a name="G-MINSHORT:CAPS"></a><h3>G_MINSHORT</h3>
143 <pre class="programlisting">#define G_MINSHORT SHRT_MIN
146 The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gshort" title="gshort"><span class="type">gshort</span></a>.
150 <div class="refsect2" title="G_MAXSHORT">
151 <a name="G-MAXSHORT:CAPS"></a><h3>G_MAXSHORT</h3>
152 <pre class="programlisting">#define G_MAXSHORT SHRT_MAX
155 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gshort" title="gshort"><span class="type">gshort</span></a>.
159 <div class="refsect2" title="G_MAXUSHORT">
160 <a name="G-MAXUSHORT:CAPS"></a><h3>G_MAXUSHORT</h3>
161 <pre class="programlisting">#define G_MAXUSHORT USHRT_MAX
164 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gushort" title="gushort"><span class="type">gushort</span></a>.
168 <div class="refsect2" title="G_MINLONG">
169 <a name="G-MINLONG:CAPS"></a><h3>G_MINLONG</h3>
170 <pre class="programlisting">#define G_MINLONG LONG_MIN
173 The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a>.
177 <div class="refsect2" title="G_MAXLONG">
178 <a name="G-MAXLONG:CAPS"></a><h3>G_MAXLONG</h3>
179 <pre class="programlisting">#define G_MAXLONG LONG_MAX
182 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#glong" title="glong"><span class="type">glong</span></a>.
186 <div class="refsect2" title="G_MAXULONG">
187 <a name="G-MAXULONG:CAPS"></a><h3>G_MAXULONG</h3>
188 <pre class="programlisting">#define G_MAXULONG ULONG_MAX
191 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gulong" title="gulong"><span class="type">gulong</span></a>.
195 <div class="refsect2" title="G_MININT8">
196 <a name="G-MININT8:CAPS"></a><h3>G_MININT8</h3>
197 <pre class="programlisting">#define G_MININT8 ((gint8) 0x80)
200 The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint8" title="gint8"><span class="type">gint8</span></a>.
202 <p class="since">Since 2.4</p>
205 <div class="refsect2" title="G_MAXINT8">
206 <a name="G-MAXINT8:CAPS"></a><h3>G_MAXINT8</h3>
207 <pre class="programlisting">#define G_MAXINT8 ((gint8) 0x7f)
210 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint8" title="gint8"><span class="type">gint8</span></a>.
212 <p class="since">Since 2.4</p>
215 <div class="refsect2" title="G_MAXUINT8">
216 <a name="G-MAXUINT8:CAPS"></a><h3>G_MAXUINT8</h3>
217 <pre class="programlisting">#define G_MAXUINT8 ((guint8) 0xff)
220 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint8" title="guint8"><span class="type">guint8</span></a>.
222 <p class="since">Since 2.4</p>
225 <div class="refsect2" title="G_MININT16">
226 <a name="G-MININT16:CAPS"></a><h3>G_MININT16</h3>
227 <pre class="programlisting">#define G_MININT16 ((gint16) 0x8000)
230 The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint16" title="gint16"><span class="type">gint16</span></a>.
232 <p class="since">Since 2.4</p>
235 <div class="refsect2" title="G_MAXINT16">
236 <a name="G-MAXINT16:CAPS"></a><h3>G_MAXINT16</h3>
237 <pre class="programlisting">#define G_MAXINT16 ((gint16) 0x7fff)
240 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint16" title="gint16"><span class="type">gint16</span></a>.
242 <p class="since">Since 2.4</p>
245 <div class="refsect2" title="G_MAXUINT16">
246 <a name="G-MAXUINT16:CAPS"></a><h3>G_MAXUINT16</h3>
247 <pre class="programlisting">#define G_MAXUINT16 ((guint16) 0xffff)
250 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint16" title="guint16"><span class="type">guint16</span></a>.
252 <p class="since">Since 2.4</p>
255 <div class="refsect2" title="G_MININT32">
256 <a name="G-MININT32:CAPS"></a><h3>G_MININT32</h3>
257 <pre class="programlisting">#define G_MININT32 ((gint32) 0x80000000)
260 The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint32" title="gint32"><span class="type">gint32</span></a>.
262 <p class="since">Since 2.4</p>
265 <div class="refsect2" title="G_MAXINT32">
266 <a name="G-MAXINT32:CAPS"></a><h3>G_MAXINT32</h3>
267 <pre class="programlisting">#define G_MAXINT32 ((gint32) 0x7fffffff)
270 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint32" title="gint32"><span class="type">gint32</span></a>.
272 <p class="since">Since 2.4</p>
275 <div class="refsect2" title="G_MAXUINT32">
276 <a name="G-MAXUINT32:CAPS"></a><h3>G_MAXUINT32</h3>
277 <pre class="programlisting">#define G_MAXUINT32 ((guint32) 0xffffffff)
280 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint32" title="guint32"><span class="type">guint32</span></a>.
282 <p class="since">Since 2.4</p>
285 <div class="refsect2" title="G_MININT64">
286 <a name="G-MININT64:CAPS"></a><h3>G_MININT64</h3>
287 <pre class="programlisting">#define G_MININT64 ((gint64) G_GINT64_CONSTANT(0x8000000000000000))
290 The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a>.
294 <div class="refsect2" title="G_MAXINT64">
295 <a name="G-MAXINT64:CAPS"></a><h3>G_MAXINT64</h3>
296 <pre class="programlisting">#define G_MAXINT64 G_GINT64_CONSTANT(0x7fffffffffffffff)
299 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gint64" title="gint64"><span class="type">gint64</span></a>.
303 <div class="refsect2" title="G_MAXUINT64">
304 <a name="G-MAXUINT64:CAPS"></a><h3>G_MAXUINT64</h3>
305 <pre class="programlisting">#define G_MAXUINT64 G_GINT64_CONSTANT(0xffffffffffffffffU)
308 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#guint64" title="guint64"><span class="type">guint64</span></a>.
312 <div class="refsect2" title="G_MAXSIZE">
313 <a name="G-MAXSIZE:CAPS"></a><h3>G_MAXSIZE</h3>
314 <pre class="programlisting">#define G_MAXSIZE G_MAXULONG
317 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gsize" title="gsize"><span class="type">gsize</span></a>.
319 <p class="since">Since 2.4</p>
322 <div class="refsect2" title="G_MINSSIZE">
323 <a name="G-MINSSIZE:CAPS"></a><h3>G_MINSSIZE</h3>
324 <pre class="programlisting">#define G_MINSSIZE G_MINLONG
327 The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a>.
329 <p class="since">Since 2.14</p>
332 <div class="refsect2" title="G_MAXSSIZE">
333 <a name="G-MAXSSIZE:CAPS"></a><h3>G_MAXSSIZE</h3>
334 <pre class="programlisting">#define G_MAXSSIZE G_MAXLONG
337 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gssize" title="gssize"><span class="type">gssize</span></a>.
339 <p class="since">Since 2.14</p>
342 <div class="refsect2" title="G_MINOFFSET">
343 <a name="G-MINOFFSET:CAPS"></a><h3>G_MINOFFSET</h3>
344 <pre class="programlisting">#define G_MINOFFSET G_MININT64
347 The minimum value which can be held in a <a class="link" href="glib-Basic-Types.html#goffset" title="goffset"><span class="type">goffset</span></a>.
351 <div class="refsect2" title="G_MAXOFFSET">
352 <a name="G-MAXOFFSET:CAPS"></a><h3>G_MAXOFFSET</h3>
353 <pre class="programlisting">#define G_MAXOFFSET G_MAXINT64
356 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#goffset" title="goffset"><span class="type">goffset</span></a>.
360 <div class="refsect2" title="G_MINFLOAT">
361 <a name="G-MINFLOAT:CAPS"></a><h3>G_MINFLOAT</h3>
362 <pre class="programlisting">#define G_MINFLOAT FLT_MIN
365 The minimum positive value which can be held in a <a class="link" href="glib-Basic-Types.html#gfloat" title="gfloat"><span class="type">gfloat</span></a>.
368 If you are interested in the smallest value which can be held in a <a class="link" href="glib-Basic-Types.html#gfloat" title="gfloat"><span class="type">gfloat</span></a>,
373 <div class="refsect2" title="G_MAXFLOAT">
374 <a name="G-MAXFLOAT:CAPS"></a><h3>G_MAXFLOAT</h3>
375 <pre class="programlisting">#define G_MAXFLOAT FLT_MAX
378 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gfloat" title="gfloat"><span class="type">gfloat</span></a>.
382 <div class="refsect2" title="G_MINDOUBLE">
383 <a name="G-MINDOUBLE:CAPS"></a><h3>G_MINDOUBLE</h3>
384 <pre class="programlisting">#define G_MINDOUBLE DBL_MIN
387 The minimum positive value which can be held in a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a>.
390 If you are interested in the smallest value which can be held in a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a>,
395 <div class="refsect2" title="G_MAXDOUBLE">
396 <a name="G-MAXDOUBLE:CAPS"></a><h3>G_MAXDOUBLE</h3>
397 <pre class="programlisting">#define G_MAXDOUBLE DBL_MAX
400 The maximum value which can be held in a <a class="link" href="glib-Basic-Types.html#gdouble" title="gdouble"><span class="type">gdouble</span></a>.
407 Generated by GTK-Doc V1.13</div>