1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>Numerical Definitions</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
<link rel="start" href="index.html" title="GLib Reference Manual">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
7
<link rel="home" href="index.html" title="GLib Reference Manual">
8
8
<link rel="up" href="glib-fundamentals.html" title="GLib Fundamentals">
9
9
<link rel="prev" href="glib-Byte-Order-Macros.html" title="Byte Order Macros">
10
10
<link rel="next" href="glib-Miscellaneous-Macros.html" title="Miscellaneous Macros">
11
<meta name="generator" content="GTK-Doc V1.9 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="glib.html" title="GLib Overview">
14
14
<link rel="chapter" href="glib-fundamentals.html" title="GLib Fundamentals">
36
37
<th width="100%" align="center">GLib Reference Manual</th>
37
38
<td><a accesskey="n" href="glib-Miscellaneous-Macros.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
39
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2899930" class="shortcut">Top</a>
41
<a href="#id2900046" class="shortcut">Description</a></nobr></td></tr>
40
<tr><td colspan="5" class="shortcuts">
41
<a href="#glib-Numerical-Definitions.synopsis" class="shortcut">Top</a>
43
<a href="#glib-Numerical-Definitions.description" class="shortcut">Description</a>
43
46
<div class="refentry" lang="en">
44
47
<a name="glib-Numerical-Definitions"></a><div class="titlepage"></div>
45
48
<div class="refnamediv"><table width="100%"><tr>
48
<a name="id2899930"></a><span class="refentrytitle">Numerical Definitions</span>
50
<p>Numerical Definitions — mathematical constants, and floating point decomposition</p>
50
<h2><span class="refentrytitle"><a name="glib-Numerical-Definitions.top_of_page"></a>Numerical Definitions</span></h2>
51
<p>Numerical Definitions — mathematical constants, and floating point decomposition</p>
52
53
<td valign="top" align="right"></td>
53
54
</tr></table></div>
54
55
<div class="refsynopsisdiv">
56
<a name="glib-Numerical-Definitions.synopsis"></a><h2>Synopsis</h2>
56
57
<pre class="synopsis">
58
59
#include <glib.h>
61
#define <a class="link" href="glib-Numerical-Definitions.html#G-IEEE754-FLOAT-BIAS:CAPS">G_IEEE754_FLOAT_BIAS</a>
62
#define <a class="link" href="glib-Numerical-Definitions.html#G-IEEE754-DOUBLE-BIAS:CAPS">G_IEEE754_DOUBLE_BIAS</a>
63
union <a class="link" href="glib-Numerical-Definitions.html#GFloatIEEE754">GFloatIEEE754</a>;
64
union <a class="link" href="glib-Numerical-Definitions.html#GDoubleIEEE754">GDoubleIEEE754</a>;
67
#define <a class="link" href="glib-Numerical-Definitions.html#G-E:CAPS">G_E</a>
68
#define <a class="link" href="glib-Numerical-Definitions.html#G-LN2:CAPS">G_LN2</a>
69
#define <a class="link" href="glib-Numerical-Definitions.html#G-LN10:CAPS">G_LN10</a>
70
#define <a class="link" href="glib-Numerical-Definitions.html#G-PI:CAPS">G_PI</a>
71
#define <a class="link" href="glib-Numerical-Definitions.html#G-PI-2:CAPS">G_PI_2</a>
72
#define <a class="link" href="glib-Numerical-Definitions.html#G-PI-4:CAPS">G_PI_4</a>
73
#define <a class="link" href="glib-Numerical-Definitions.html#G-SQRT2:CAPS">G_SQRT2</a>
74
#define <a class="link" href="glib-Numerical-Definitions.html#G-LOG-2-BASE-10:CAPS">G_LOG_2_BASE_10</a>
61
#define <a class="link" href="glib-Numerical-Definitions.html#G-IEEE754-FLOAT-BIAS--CAPS" title="G_IEEE754_FLOAT_BIAS">G_IEEE754_FLOAT_BIAS</a>
62
#define <a class="link" href="glib-Numerical-Definitions.html#G-IEEE754-DOUBLE-BIAS--CAPS" title="G_IEEE754_DOUBLE_BIAS">G_IEEE754_DOUBLE_BIAS</a>
63
union <a class="link" href="glib-Numerical-Definitions.html#GFloatIEEE754" title="union GFloatIEEE754">GFloatIEEE754</a>;
64
union <a class="link" href="glib-Numerical-Definitions.html#GDoubleIEEE754" title="union GDoubleIEEE754">GDoubleIEEE754</a>;
67
#define <a class="link" href="glib-Numerical-Definitions.html#G-E--CAPS" title="G_E">G_E</a>
68
#define <a class="link" href="glib-Numerical-Definitions.html#G-LN2--CAPS" title="G_LN2">G_LN2</a>
69
#define <a class="link" href="glib-Numerical-Definitions.html#G-LN10--CAPS" title="G_LN10">G_LN10</a>
70
#define <a class="link" href="glib-Numerical-Definitions.html#G-PI--CAPS" title="G_PI">G_PI</a>
71
#define <a class="link" href="glib-Numerical-Definitions.html#G-PI-2--CAPS" title="G_PI_2">G_PI_2</a>
72
#define <a class="link" href="glib-Numerical-Definitions.html#G-PI-4--CAPS" title="G_PI_4">G_PI_4</a>
73
#define <a class="link" href="glib-Numerical-Definitions.html#G-SQRT2--CAPS" title="G_SQRT2">G_SQRT2</a>
74
#define <a class="link" href="glib-Numerical-Definitions.html#G-LOG-2-BASE-10--CAPS" title="G_LOG_2_BASE_10">G_LOG_2_BASE_10</a>
77
77
<div class="refsect1" lang="en">
78
<a name="id2900046"></a><h2>Description</h2>
78
<a name="glib-Numerical-Definitions.description"></a><h2>Description</h2>
80
GLib offers mathematical constants such as <a class="link" href="glib-Numerical-Definitions.html#G-PI:CAPS"><span class="type">G_PI</span></a> for the value of pi;
80
GLib offers mathematical constants such as <a class="link" href="glib-Numerical-Definitions.html#G-PI--CAPS" title="G_PI"><span class="type">G_PI</span></a> for the value of pi;
81
81
many platforms have these in the C library, but some don't, the GLib
82
82
versions always exist.
85
The <a class="link" href="glib-Numerical-Definitions.html#GFloatIEEE754"><span class="type">GFloatIEEE754</span></a> and <a class="link" href="glib-Numerical-Definitions.html#GDoubleIEEE754"><span class="type">GDoubleIEEE754</span></a> unions are used to access the
85
The <a class="link" href="glib-Numerical-Definitions.html#GFloatIEEE754" title="union GFloatIEEE754"><span class="type">GFloatIEEE754</span></a> and <a class="link" href="glib-Numerical-Definitions.html#GDoubleIEEE754" title="union GDoubleIEEE754"><span class="type">GDoubleIEEE754</span></a> unions are used to access the
86
86
sign, mantissa and exponent of IEEE floats and doubles. These
87
unions are defined as appropriate for a given platform.
87
unions are defined as appropriate for a given platform.
88
88
IEEE floats and doubles are supported (used for
89
89
storage) by at least Intel, PPC and Sparc, for reference: <a class="ulink" href="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html" target="_top">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</a>
92
92
<div class="refsect1" lang="en">
93
<a name="id2900104"></a><h2>Details</h2>
94
<div class="refsect2" lang="en">
95
<a name="id2900114"></a><h3>
96
<a name="G-IEEE754-FLOAT-BIAS:CAPS"></a>G_IEEE754_FLOAT_BIAS</h3>
97
<a class="indexterm" name="id2900127"></a><pre class="programlisting">#define G_IEEE754_FLOAT_BIAS (127)
100
See <a class="ulink" href="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html" target="_top">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</a>
104
<div class="refsect2" lang="en">
105
<a name="id2900151"></a><h3>
106
<a name="G-IEEE754-DOUBLE-BIAS:CAPS"></a>G_IEEE754_DOUBLE_BIAS</h3>
107
<a class="indexterm" name="id2900164"></a><pre class="programlisting">#define G_IEEE754_DOUBLE_BIAS (1023)
110
See <a class="ulink" href="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html" target="_top">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</a>
114
<div class="refsect2" lang="en">
115
<a name="id2900188"></a><h3>
116
<a name="GFloatIEEE754"></a>union GFloatIEEE754</h3>
117
<a class="indexterm" name="id2900200"></a><pre class="programlisting">union GFloatIEEE754
93
<a name="glib-Numerical-Definitions.details"></a><h2>Details</h2>
94
<div class="refsect2" lang="en">
95
<a name="G-IEEE754-FLOAT-BIAS--CAPS"></a><h3>G_IEEE754_FLOAT_BIAS</h3>
96
<pre class="programlisting">#define G_IEEE754_FLOAT_BIAS (127)
99
See <a class="ulink" href="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html" target="_top">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</a>
103
<div class="refsect2" lang="en">
104
<a name="G-IEEE754-DOUBLE-BIAS--CAPS"></a><h3>G_IEEE754_DOUBLE_BIAS</h3>
105
<pre class="programlisting">#define G_IEEE754_DOUBLE_BIAS (1023)
108
See <a class="ulink" href="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html" target="_top">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</a>
112
<div class="refsect2" lang="en">
113
<a name="GFloatIEEE754"></a><h3>union GFloatIEEE754</h3>
114
<pre class="programlisting">union GFloatIEEE754
128
The <a class="link" href="glib-Numerical-Definitions.html#GFloatIEEE754"><span class="type">GFloatIEEE754</span></a> and <a class="link" href="glib-Numerical-Definitions.html#GDoubleIEEE754"><span class="type">GDoubleIEEE754</span></a> unions are used to access the
125
The <a class="link" href="glib-Numerical-Definitions.html#GFloatIEEE754" title="union GFloatIEEE754"><span class="type">GFloatIEEE754</span></a> and <a class="link" href="glib-Numerical-Definitions.html#GDoubleIEEE754" title="union GDoubleIEEE754"><span class="type">GDoubleIEEE754</span></a> unions are used to access the
129
126
sign, mantissa and exponent of IEEE floats and doubles. These
130
unions are defined as appropriate for a given platform.
127
unions are defined as appropriate for a given platform.
131
128
IEEE floats and doubles are supported (used for
132
storage) by at least Intel, PPC and Sparc, for reference:
129
storage) by at least Intel, PPC and Sparc, for reference:
133
130
<a class="ulink" href="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html" target="_top">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</a>
137
134
<div class="refsect2" lang="en">
138
<a name="id2900247"></a><h3>
139
<a name="GDoubleIEEE754"></a>union GDoubleIEEE754</h3>
140
<a class="indexterm" name="id2900260"></a><pre class="programlisting">union GDoubleIEEE754
135
<a name="GDoubleIEEE754"></a><h3>union GDoubleIEEE754</h3>
136
<pre class="programlisting">union GDoubleIEEE754
142
138
gdouble v_double;
152
The <a class="link" href="glib-Numerical-Definitions.html#GFloatIEEE754"><span class="type">GFloatIEEE754</span></a> and <a class="link" href="glib-Numerical-Definitions.html#GDoubleIEEE754"><span class="type">GDoubleIEEE754</span></a> unions are used to access the
148
The <a class="link" href="glib-Numerical-Definitions.html#GFloatIEEE754" title="union GFloatIEEE754"><span class="type">GFloatIEEE754</span></a> and <a class="link" href="glib-Numerical-Definitions.html#GDoubleIEEE754" title="union GDoubleIEEE754"><span class="type">GDoubleIEEE754</span></a> unions are used to access the
153
149
sign, mantissa and exponent of IEEE floats and doubles. These
154
unions are defined as appropriate for a given platform.
150
unions are defined as appropriate for a given platform.
155
151
IEEE floats and doubles are supported (used for
156
storage) by at least Intel, PPC and Sparc, for reference:
152
storage) by at least Intel, PPC and Sparc, for reference:
157
153
<a class="ulink" href="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html" target="_top">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</a>
161
157
<div class="refsect2" lang="en">
162
<a name="id2900307"></a><h3>
163
<a name="G-E:CAPS"></a>G_E</h3>
164
<a class="indexterm" name="id2900319"></a><pre class="programlisting">#define G_E 2.7182818284590452353602874713526624977572470937000
158
<a name="G-E--CAPS"></a><h3>G_E</h3>
159
<pre class="programlisting">#define G_E 2.7182818284590452353602874713526624977572470937000
167
162
The base of natural logarithms.
231
220
<div class="refsect2" lang="en">
232
<a name="id2900508"></a><h3>
233
<a name="G-LOG-2-BASE-10:CAPS"></a>G_LOG_2_BASE_10</h3>
234
<a class="indexterm" name="id2900522"></a><pre class="programlisting">#define G_LOG_2_BASE_10 (0.30102999566398119521)
221
<a name="G-LOG-2-BASE-10--CAPS"></a><h3>G_LOG_2_BASE_10</h3>
222
<pre class="programlisting">#define G_LOG_2_BASE_10 (0.30102999566398119521)
237
Used for fooling around with float formats, see
225
Used for fooling around with float formats, see
238
226
<a class="ulink" href="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html" target="_top">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</a>
242
230
<div class="refsect1" lang="en">
243
<a name="id2900547"></a><h2>See Also</h2>
231
<a name="glib-Numerical-Definitions.see-also"></a><h2>See Also</h2>
245
233
<a class="ulink" href="http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html" target="_top">http://cch.loria.fr/documentation/IEEE754/numerical_comp_guide/ncg_math.doc.html</a>
248
<div class="refsect1" lang="en">
249
<a name="id2900565"></a><div class="refsect2" lang="en"><a name="id2900566"></a></div>
251
<div class="refsect2" lang="en"><a name="id2900568"></a></div>
239
Generated by GTK-Doc V1.11</div>