glib-Limits-of-Basic-Types.html   [plain text]


<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Limits of Basic Types</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="GLib Reference Manual"><link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="previous" href="glib-Basic-Types.html" title="Basic Types"><link rel="next" href="glib-Standard-Macros.html" title="Standard Macros"><link rel="chapter" href="glib.html" title="GLib Overview"><link rel="refentry" href="glib-building.html" title="Compiling the GLib package"><link rel="refentry" href="glib-cross-compiling.html" title="Cross-compiling the GLib package"><link rel="refentry" href="glib-compiling.html" title="Compiling GLib Applications"><link rel="refentry" href="glib-running.html" title="Running GLib Applications"><link rel="refentry" href="glib-changes.html" title="Changes to GLib"><link rel="refentry" href="glib-resources.html" title="Mailing lists and bug reports"><link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals"><link rel="refentry" href="glib-Basic-Types.html" title="Basic Types"><link rel="refentry" href="glib-Limits-of-Basic-Types.html" title="Limits of Basic Types"><link rel="refentry" href="glib-Standard-Macros.html" title="Standard Macros"><link rel="refentry" href="glib-Type-Conversion-Macros.html" title="Type Conversion Macros"><link rel="refentry" href="glib-Byte-Order-Macros.html" title="Byte Order Macros"><link rel="refentry" href="glib-Numerical-Definitions.html" title="Numerical Definitions"><link rel="refentry" href="glib-Miscellaneous-Macros.html" title="Miscellaneous Macros"><link rel="refentry" href="glib-Atomic-Operations.html" title="Atomic Operations"><link rel="chapter" href="glib-core.html" title="GLib Core Application Support"><link rel="refentry" href="glib-The-Main-Event-Loop.html" title="The Main Event Loop"><link rel="refentry" href="glib-Threads.html" title="
Threads"><link rel="refentry" href="glib-Thread-Pools.html" title="Thread Pools"><link rel="refentry" href="glib-Asynchronous-Queues.html" title="Asynchronous Queues"><link rel="refentry" href="glib-Dynamic-Loading-of-Modules.html" title="Dynamic Loading of Modules"><link rel="refentry" href="glib-Memory-Allocation.html" title="Memory Allocation"><link rel="refentry" href="glib-IO-Channels.html" title="IO Channels"><link rel="refentry" href="glib-Error-Reporting.html" title="Error Reporting"><link rel="refentry" href="glib-Warnings-and-Assertions.html" title="Message Output and Debugging Functions"><link rel="refentry" href="glib-Message-Logging.html" title="Message Logging"><link rel="chapter" href="glib-utilities.html" title="GLib Utilities"><link rel="refentry" href="glib-String-Utility-Functions.html" title="String Utility Functions"><link rel="refentry" href="glib-Character-Set-Conversion.html" title="Character Set Conversion"><link rel="refentry" href="glib-Unicode-Manipulation.html" title="Unicode Manipulation"><link rel="refentry" href="glib-I18N.html" title="Internationalization"><link rel="refentry" href="glib-Date-and-Time-Functions.html" title="Date and Time Functions"><link rel="refentry" href="glib-Random-Numbers.html" title="Random Numbers"><link rel="refentry" href="glib-Hook-Functions.html" title="Hook Functions"><link rel="refentry" href="glib-Miscellaneous-Utility-Functions.html" title="Miscellaneous Utility Functions"><link rel="refentry" href="glib-Lexical-Scanner.html" title="Lexical Scanner"><link rel="refentry" href="glib-Automatic-String-Completion.html" title="Automatic String Completion"><link rel="refentry" href="glib-Timers.html" title="Timers"><link rel="refentry" href="glib-Spawning-Processes.html" title="Spawning Processes"><link rel="refentry" href="glib-File-Utilities.html" title="File Utilities"><link rel="refentry" href="glib-Shell-related-Utilities.html" title="Shell-related Utilities"><link rel="refentry" href="glib-Glob-style-pattern-matching.html" title="Glob-style pattern matching"><link rel="refentry" href="glib-Simple-XML-Subset-Parser.html" title="Simple XML Subset Parser"><link rel="refentry" href="glib-Windows-Compatability-Functions.html" title="Windows Compatibility Functions"><link rel="chapter" href="glib-data-types.html" title="GLib Data Types"><link rel="refentry" href="glib-Memory-Chunks.html" title="Memory Chunks"><link rel="refentry" href="glib-Doubly-Linked-Lists.html" title="Doubly-Linked Lists"><link rel="refentry" href="glib-Singly-Linked-Lists.html" title="Singly-Linked Lists"><link rel="refentry" href="glib-Double-ended-Queues.html" title="Double-ended Queues"><link rel="refentry" href="glib-Trash-Stacks.html" title="Trash Stacks"><link rel="refentry" href="glib-Hash-Tables.html" title="Hash Tables"><link rel="refentry" href="glib-Strings.html" title="Strings"><link rel="refentry" href="glib-String-Chunks.html" title="String Chunks"><link rel="refentry" href="glib-Arrays.html" title="Arrays"><link rel="refentry" href="glib-Pointer-Arrays.html" title="Pointer Arrays"><link rel="refentry" href="glib-Byte-Arrays.html" title="Byte Arrays"><link rel="refentry" href="glib-Balanced-Binary-Trees.html" title="Balanced Binary Trees"><link rel="refentry" href="glib-N-ary-Trees.html" title="N-ary Trees"><link rel="refentry" href="glib-Quarks.html" title="Quarks"><link rel="refentry" href="glib-Keyed-Data-Lists.html" title="Keyed Data Lists"><link rel="refentry" href="glib-Datasets.html" title="Datasets"><link rel="refentry" href="glib-Relations-and-Tuples.html" title="Relations and Tuples"><link rel="refentry" href="glib-Caches.html" title="Caches"><link rel="refentry" href="glib-Memory-Allocators.html" title="Memory Allocators"><link rel="chapter" href="tools.html" title="GLib Tools"><link rel="refentry" href="glib-gettextize.html" title="glib-gettextize"><link rel="index" href="ix01.html" title="Index"><link rel="section" href="glib-Limits-of-Basic-Types.html#id2976388" title="Description"><link rel="section" href="glib-Limits-of-Basic-Types.html#id2976400" title="Details"><meta name="generator" content="GTK-Doc V1.2 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="glib-Basic-Types.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="glib-fundamentals.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">GLib Reference Manual</th><td><a accesskey="n" href="glib-Standard-Macros.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="glib-Limits-of-Basic-Types"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2><span class="refentrytitle">Limits of Basic Types</span></h2><p>Limits of Basic Types &#8212; portable method of determining the limits of the standard types.</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">

#include &lt;glib.h&gt;


#define     <a href="glib-Limits-of-Basic-Types.html#G-MININT-CAPS">G_MININT</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXINT-CAPS">G_MAXINT</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXUINT-CAPS">G_MAXUINT</a>

#define     <a href="glib-Limits-of-Basic-Types.html#G-MINSHORT-CAPS">G_MINSHORT</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXSHORT-CAPS">G_MAXSHORT</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXUSHORT-CAPS">G_MAXUSHORT</a>

#define     <a href="glib-Limits-of-Basic-Types.html#G-MINLONG-CAPS">G_MINLONG</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXLONG-CAPS">G_MAXLONG</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXULONG-CAPS">G_MAXULONG</a>

#define     <a href="glib-Limits-of-Basic-Types.html#G-MININT8-CAPS">G_MININT8</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXINT8-CAPS">G_MAXINT8</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXUINT8-CAPS">G_MAXUINT8</a>

#define     <a href="glib-Limits-of-Basic-Types.html#G-MININT16-CAPS">G_MININT16</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXINT16-CAPS">G_MAXINT16</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXUINT16-CAPS">G_MAXUINT16</a>

#define     <a href="glib-Limits-of-Basic-Types.html#G-MININT32-CAPS">G_MININT32</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXINT32-CAPS">G_MAXINT32</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXUINT32-CAPS">G_MAXUINT32</a>

#define     <a href="glib-Limits-of-Basic-Types.html#G-MININT64-CAPS">G_MININT64</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXINT64-CAPS">G_MAXINT64</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXUINT64-CAPS">G_MAXUINT64</a>

#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXSIZE-CAPS">G_MAXSIZE</a>

#define     <a href="glib-Limits-of-Basic-Types.html#G-MINFLOAT-CAPS">G_MINFLOAT</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXFLOAT-CAPS">G_MAXFLOAT</a>

#define     <a href="glib-Limits-of-Basic-Types.html#G-MINDOUBLE-CAPS">G_MINDOUBLE</a>
#define     <a href="glib-Limits-of-Basic-Types.html#G-MAXDOUBLE-CAPS">G_MAXDOUBLE</a>
</pre></div><div class="refsect1" lang="en"><a name="id2976388"></a><h2>Description</h2><p>
These macros provide a portable method to determine the limits of some of
the standard integer and floating point types.
</p></div><div class="refsect1" lang="en"><a name="id2976400"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2976406"></a><h3><a name="G-MININT-CAPS"></a>G_MININT</h3><a class="indexterm" name="id2976416"></a><pre class="programlisting">#define G_MININT	INT_MIN
</pre><p>
The minimum value which can be held in a <a href="glib-Basic-Types.html#gint"><span class="type">gint</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2976440"></a><h3><a name="G-MAXINT-CAPS"></a>G_MAXINT</h3><a class="indexterm" name="id2976450"></a><pre class="programlisting">#define G_MAXINT	INT_MAX
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gint"><span class="type">gint</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2976474"></a><h3><a name="G-MAXUINT-CAPS"></a>G_MAXUINT</h3><a class="indexterm" name="id2976484"></a><pre class="programlisting">#define G_MAXUINT	UINT_MAX
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#guint"><span class="type">guint</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2976508"></a><h3><a name="G-MINSHORT-CAPS"></a>G_MINSHORT</h3><a class="indexterm" name="id2976518"></a><pre class="programlisting">#define G_MINSHORT	SHRT_MIN
</pre><p>
The minimum value which can be held in a <a href="glib-Basic-Types.html#gshort"><span class="type">gshort</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2976542"></a><h3><a name="G-MAXSHORT-CAPS"></a>G_MAXSHORT</h3><a class="indexterm" name="id2976553"></a><pre class="programlisting">#define G_MAXSHORT	SHRT_MAX
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gshort"><span class="type">gshort</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2976576"></a><h3><a name="G-MAXUSHORT-CAPS"></a>G_MAXUSHORT</h3><a class="indexterm" name="id2976587"></a><pre class="programlisting">#define G_MAXUSHORT	USHRT_MAX
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gushort"><span class="type">gushort</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2976610"></a><h3><a name="G-MINLONG-CAPS"></a>G_MINLONG</h3><a class="indexterm" name="id2976621"></a><pre class="programlisting">#define G_MINLONG	LONG_MIN
</pre><p>
The minimum value which can be held in a <a href="glib-Basic-Types.html#glong"><span class="type">glong</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2976644"></a><h3><a name="G-MAXLONG-CAPS"></a>G_MAXLONG</h3><a class="indexterm" name="id2976655"></a><pre class="programlisting">#define G_MAXLONG	LONG_MAX
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#glong"><span class="type">glong</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2976678"></a><h3><a name="G-MAXULONG-CAPS"></a>G_MAXULONG</h3><a class="indexterm" name="id2976689"></a><pre class="programlisting">#define G_MAXULONG	ULONG_MAX
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gulong"><span class="type">gulong</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2976713"></a><h3><a name="G-MININT8-CAPS"></a>G_MININT8</h3><a class="indexterm" name="id2976723"></a><pre class="programlisting">#define G_MININT8	((gint8)  0x80)
</pre><p>
The minimum value which can be held in a <a href="glib-Basic-Types.html#gint8"><span class="type">gint8</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2976751"></a><h3><a name="G-MAXINT8-CAPS"></a>G_MAXINT8</h3><a class="indexterm" name="id2976763"></a><pre class="programlisting">#define G_MAXINT8	((gint8)  0x7f)
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gint8"><span class="type">gint8</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2976790"></a><h3><a name="G-MAXUINT8-CAPS"></a>G_MAXUINT8</h3><a class="indexterm" name="id2976801"></a><pre class="programlisting">#define G_MAXUINT8	((guint8) 0xff)
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#guint8"><span class="type">guint8</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2976829"></a><h3><a name="G-MININT16-CAPS"></a>G_MININT16</h3><a class="indexterm" name="id2976840"></a><pre class="programlisting">#define G_MININT16	((gint16)  0x8000)
</pre><p>
The minimum value which can be held in a <a href="glib-Basic-Types.html#gint16"><span class="type">gint16</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2976868"></a><h3><a name="G-MAXINT16-CAPS"></a>G_MAXINT16</h3><a class="indexterm" name="id2976879"></a><pre class="programlisting">#define G_MAXINT16	((gint16)  0x7fff)
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gint16"><span class="type">gint16</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2976907"></a><h3><a name="G-MAXUINT16-CAPS"></a>G_MAXUINT16</h3><a class="indexterm" name="id2976918"></a><pre class="programlisting">#define G_MAXUINT16	((guint16) 0xffff)
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#guint16"><span class="type">guint16</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2976946"></a><h3><a name="G-MININT32-CAPS"></a>G_MININT32</h3><a class="indexterm" name="id2976956"></a><pre class="programlisting">#define G_MININT32	((gint32)  0x80000000)
</pre><p>
The minimum value which can be held in a <a href="glib-Basic-Types.html#gint32"><span class="type">gint32</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2976984"></a><h3><a name="G-MAXINT32-CAPS"></a>G_MAXINT32</h3><a class="indexterm" name="id2976995"></a><pre class="programlisting">#define G_MAXINT32	((gint32)  0x7fffffff)
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gint32"><span class="type">gint32</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2977023"></a><h3><a name="G-MAXUINT32-CAPS"></a>G_MAXUINT32</h3><a class="indexterm" name="id2977034"></a><pre class="programlisting">#define G_MAXUINT32	((guint32) 0xffffffff)
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#guint32"><span class="type">guint32</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2977062"></a><h3><a name="G-MININT64-CAPS"></a>G_MININT64</h3><a class="indexterm" name="id2977073"></a><pre class="programlisting">#define G_MININT64	G_GINT64_CONSTANT(0x8000000000000000)
</pre><p>
The minimum value which can be held in a <a href="glib-Basic-Types.html#gint64"><span class="type">gint64</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2977097"></a><h3><a name="G-MAXINT64-CAPS"></a>G_MAXINT64</h3><a class="indexterm" name="id2977108"></a><pre class="programlisting">#define G_MAXINT64	G_GINT64_CONSTANT(0x7fffffffffffffff)
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gint64"><span class="type">gint64</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2977132"></a><h3><a name="G-MAXUINT64-CAPS"></a>G_MAXUINT64</h3><a class="indexterm" name="id2977143"></a><pre class="programlisting">#define G_MAXUINT64	G_GINT64_CONSTANT(0xffffffffffffffffU)
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#guint64"><span class="type">guint64</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2977167"></a><h3><a name="G-MAXSIZE-CAPS"></a>G_MAXSIZE</h3><a class="indexterm" name="id2977178"></a><pre class="programlisting">#define G_MAXSIZE	G_MAXUINT
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gsize"><span class="type">gsize</span></a>.
</p><p>Since 2.4


</p></div><hr><div class="refsect2" lang="en"><a name="id2977206"></a><h3><a name="G-MINFLOAT-CAPS"></a>G_MINFLOAT</h3><a class="indexterm" name="id2977217"></a><pre class="programlisting">#define G_MINFLOAT	FLT_MIN
</pre><p>
The minimum positive value which can be held in a <a href="glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a>.
</p><p>
If you are interested in the smallest value which can be held in a <a href="glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a>,
use -G_MAX_FLOAT.
</p></div><hr><div class="refsect2" lang="en"><a name="id2977253"></a><h3><a name="G-MAXFLOAT-CAPS"></a>G_MAXFLOAT</h3><a class="indexterm" name="id2977264"></a><pre class="programlisting">#define G_MAXFLOAT	FLT_MAX
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gfloat"><span class="type">gfloat</span></a>.
</p></div><hr><div class="refsect2" lang="en"><a name="id2977287"></a><h3><a name="G-MINDOUBLE-CAPS"></a>G_MINDOUBLE</h3><a class="indexterm" name="id2977298"></a><pre class="programlisting">#define G_MINDOUBLE	DBL_MIN
</pre><p>
The minimum positive value which can be held in a <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>.
</p><p>
If you are interested in the smallest value which can be held in a <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>,
use -G_MAXDOUBLE.
</p></div><hr><div class="refsect2" lang="en"><a name="id2977334"></a><h3><a name="G-MAXDOUBLE-CAPS"></a>G_MAXDOUBLE</h3><a class="indexterm" name="id2977346"></a><pre class="programlisting">#define G_MAXDOUBLE	DBL_MAX
</pre><p>
The maximum value which can be held in a <a href="glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a>.
</p></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="glib-Basic-Types.html"><b>&lt;&lt; Basic Types</b></a></td><td align="right"><a accesskey="n" href="glib-Standard-Macros.html"><b>Standard Macros &gt;&gt;</b></a></td></tr></table></body></html>