~ubuntu-branches/ubuntu/trusty/khronos-opencl-man/trusty

« back to all changes in this revision

Viewing changes to mathConstants.xml

  • Committer: Package Import Robot
  • Author(s): Mathieu Malaterre
  • Date: 2013-05-21 18:06:15 UTC
  • Revision ID: package-import@ubuntu.com-20130521180615-6e0s2n3pai95ip2f
Tags: upstream-1.0~svn21772
ImportĀ upstreamĀ versionĀ 1.0~svn21772

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
 
3
              "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
 
4
 
 
5
<refentry>
 
6
    <refentryinfo>
 
7
        <keywordset>
 
8
            <keyword>Symbolic Math Constants</keyword>
 
9
        </keywordset>
 
10
    </refentryinfo>
 
11
 
 
12
    <refmeta>
 
13
        <refentrytitle>Symbolic Math Constants</refentrytitle>
 
14
 
 
15
        <refmiscinfo>
 
16
            <copyright>
 
17
                <year>2007-2011</year>
 
18
                <holder>The Khronos Group Inc.
 
19
 Permission is hereby granted, free of charge, to any person obtaining a
 
20
copy of this software and/or associated documentation files (the
 
21
"Materials"), to deal in the Materials without restriction, including
 
22
without limitation the rights to use, copy, modify, merge, publish,
 
23
distribute, sublicense, and/or sell copies of the Materials, and to
 
24
permit persons to whom the Materials are furnished to do so, subject to
 
25
the condition that this copyright notice and permission notice shall be included
 
26
in all copies or substantial portions of the Materials.</holder>
 
27
            </copyright>
 
28
        </refmiscinfo>
 
29
        <manvolnum>3</manvolnum>
 
30
    </refmeta>
 
31
 
 
32
<!-- ================================ SYNOPSIS -->
 
33
 
 
34
    <refnamediv id="SymbolicMathConstants">
 
35
        <refname>Symbolic Math Constants</refname>
 
36
 
 
37
        <refpurpose>
 
38
             The following symbolic constants are available.
 
39
        </refpurpose>
 
40
    </refnamediv>
 
41
 
 
42
<!-- ================================ DESCRIPTION  -->
 
43
 
 
44
    <refsect1 id="description"><title>Built-in Math Constants</title>
 
45
        <para>
 
46
          The following symbolic constants are available.  Their values are of type
 
47
          <type>float</type> and are accurate within the precision of a single precision
 
48
          floating-point number.
 
49
        </para>
 
50
 
 
51
        <informaltable frame="all">
 
52
            <tgroup cols="2" align="left" colsep="1" rowsep="1">
 
53
                <colspec colname="col1" colnum="1" />
 
54
                <colspec colname="col2" colnum="2" />
 
55
 
 
56
                <thead>
 
57
                    <row>
 
58
                        <entry>Constant Name</entry>
 
59
                        <entry>Description</entry>
 
60
                    </row>
 
61
                </thead>
 
62
 
 
63
                <tbody>
 
64
 
 
65
                    <row>
 
66
                        <entry> MAXFLOAT </entry>
 
67
                        <entry>
 
68
                            Value of maximum non-infinite single-precision floating-point number.
 
69
                        </entry>
 
70
                    </row>
 
71
 
 
72
                    <row>
 
73
                        <entry> HUGE_VALF </entry>
 
74
 
 
75
                        <entry>
 
76
                            A positive float constant expression. <constant>HUGE_VALF</constant> evaluates to +infinity.
 
77
                            Used as an error value returned by the
 
78
  <citerefentry href="mathFunctions"><refentrytitle>built-in math functions</refentrytitle></citerefentry>.
 
79
                        </entry>
 
80
                    </row>
 
81
 
 
82
                    <row>
 
83
                        <entry> INFINITY </entry>
 
84
 
 
85
                        <entry>
 
86
                            A constant expression of type <type>float</type> representing positive or unsigned infinity.
 
87
                        </entry>
 
88
                    </row>
 
89
 
 
90
                    <row>
 
91
                        <entry> NAN </entry>
 
92
 
 
93
                        <entry>
 
94
                            A constant expression of type <type>float</type> representing a quiet NaN.
 
95
                        </entry>
 
96
                    </row>
 
97
 
 
98
                </tbody>
 
99
            </tgroup>
 
100
        </informaltable>
 
101
 
 
102
        <para>
 
103
          If double precision is supported by the device, the following symbolic constant will
 
104
          also be available:
 
105
        </para>
 
106
 
 
107
        <informaltable frame="all">
 
108
            <tgroup cols="2" align="left" colsep="1" rowsep="1">
 
109
                <colspec colname="col1" colnum="1" />
 
110
                <colspec colname="col2" colnum="2" />
 
111
 
 
112
                <thead>
 
113
                    <row>
 
114
                        <entry>Constant Name</entry>
 
115
                        <entry>Description</entry>
 
116
                    </row>
 
117
                </thead>
 
118
 
 
119
                <tbody>
 
120
 
 
121
                    <row>
 
122
                        <entry>
 
123
                            HUGE_VAL
 
124
                        </entry>
 
125
 
 
126
                        <entry>
 
127
                            <para>
 
128
                              A positive double constant expression. <constant>HUGE_VAL</constant>
 
129
                              evaluates to +infinity.  Used as an error value returned by the
 
130
                              built-in math functions.
 
131
                            </para>
 
132
                        </entry>
 
133
                    </row>
 
134
                </tbody>
 
135
            </tgroup>
 
136
        </informaltable>
 
137
 
 
138
        <para>
 
139
          The following constants are also available. They are of type <type>float</type>
 
140
          and are accurate within the precision of the <type>float</type> type.
 
141
        </para>
 
142
 
 
143
        <informaltable frame="all">
 
144
            <tgroup cols="2" align="left" colsep="1" rowsep="1">
 
145
                <colspec colname="col1" colnum="1" />
 
146
                <colspec colname="col2" colnum="2" />
 
147
 
 
148
                <thead>
 
149
                    <row>
 
150
                        <entry>Constant Name</entry>
 
151
                        <entry>Description</entry>
 
152
                    </row>
 
153
                </thead>
 
154
 
 
155
                <tbody>
 
156
                    <row>
 
157
                        <entry>M_E_F</entry>
 
158
                        <entry>Value of e</entry>
 
159
                    </row>
 
160
                    <row>
 
161
                        <entry>M_LOG2E_F</entry>
 
162
                        <entry>Value of log<subscript>2</subscript>e</entry>
 
163
                    </row>
 
164
                    <row>
 
165
                        <entry>M_LOG10E_F</entry>
 
166
                        <entry>Value of log<subscript>10</subscript>e</entry>
 
167
                    </row>
 
168
                    <row>
 
169
                        <entry>M_LN2_F</entry>
 
170
                        <entry>Value of log<subscript>e</subscript>2</entry>
 
171
                    </row>
 
172
                    <row>
 
173
                        <entry>M_LN10_F</entry>
 
174
                        <entry>Value of log<subscript>e</subscript>10</entry>
 
175
                    </row>
 
176
                    <row>
 
177
                        <entry>M_PI_F</entry>
 
178
                        <entry>Value of pi</entry>
 
179
                    </row>
 
180
                    <row>
 
181
                        <entry>M_PI_2_F</entry>
 
182
                        <entry>Value of pi / 2</entry>
 
183
                    </row>
 
184
                    <row>
 
185
                        <entry>M_PI_4_F</entry>
 
186
                        <entry>Value of pi / 4</entry>
 
187
                    </row>
 
188
                    <row>
 
189
                        <entry>M_1_PI_F</entry>
 
190
                        <entry>Value of 1 / pi</entry>
 
191
                    </row>
 
192
                    <row>
 
193
                        <entry>M_2_PI_F</entry>
 
194
                        <entry>Value of 2 / pi</entry>
 
195
                    </row>
 
196
                    <row>
 
197
                        <entry>M_2_SQRTPI_F</entry>
 
198
                        <entry>Value of 2 / (square root of pi)</entry>
 
199
                    </row>
 
200
                    <row>
 
201
                        <entry>M_SQRT2_F</entry>
 
202
                        <entry>Value of square root of 2</entry>
 
203
                    </row>
 
204
                    <row>
 
205
                        <entry>M_SQRT1_2_F</entry>
 
206
                        <entry>Value of 1 / (square root of 2)</entry>
 
207
                    </row>
 
208
                </tbody>
 
209
            </tgroup>
 
210
        </informaltable>
 
211
 
 
212
        <para>
 
213
          If double precision is supported by the device, the following macros and constants
 
214
          are also available. They are of type <type>double</type> and are accurate within the
 
215
          precision of the <type>double</type> type.
 
216
        </para>
 
217
 
 
218
        <informaltable frame="all">
 
219
            <tgroup cols="2" align="left" colsep="1" rowsep="1">
 
220
                <colspec colname="col1" colnum="1" />
 
221
                <colspec colname="col2" colnum="2" />
 
222
 
 
223
                <thead>
 
224
                    <row>
 
225
                        <entry>Constant Name</entry>
 
226
                        <entry>Description</entry>
 
227
                    </row>
 
228
                </thead>
 
229
 
 
230
                <tbody>
 
231
                    <row>
 
232
                        <entry>M_E</entry>
 
233
                        <entry>Value of e</entry>
 
234
                    </row>
 
235
                    <row>
 
236
                        <entry>M_LOG2E</entry>
 
237
                        <entry>Value of log<subscript>2</subscript>e</entry>
 
238
                    </row>
 
239
                    <row>
 
240
                        <entry>M_LOG10E</entry>
 
241
                        <entry>Value of log<subscript>10</subscript>e</entry>
 
242
                    </row>
 
243
                    <row>
 
244
                        <entry>M_LN2</entry>
 
245
                        <entry>Value of log<subscript>e</subscript>2</entry>
 
246
                    </row>
 
247
                    <row>
 
248
                        <entry>M_LN10</entry>
 
249
                        <entry>Value of log<subscript>e</subscript>10</entry>
 
250
                    </row>
 
251
                    <row>
 
252
                        <entry>M_PI</entry>
 
253
                        <entry>Value of pi</entry>
 
254
                    </row>
 
255
                    <row>
 
256
                        <entry>M_PI_2</entry>
 
257
                        <entry>Value of pi / 2</entry>
 
258
                    </row>
 
259
                    <row>
 
260
                        <entry>M_PI_4</entry>
 
261
                        <entry>Value of pi / 4</entry>
 
262
                    </row>
 
263
                    <row>
 
264
                        <entry>M_1_PI</entry>
 
265
                        <entry>Value of 1 / pi</entry>
 
266
                    </row>
 
267
                    <row>
 
268
                        <entry>M_2_PI</entry>
 
269
                        <entry>Value of 2 / pi</entry>
 
270
                    </row>
 
271
                    <row>
 
272
                        <entry>M_2_SQRTPI</entry>
 
273
                        <entry>Value of 2 / (square root of pi)</entry>
 
274
                    </row>
 
275
                    <row>
 
276
                        <entry>M_SQRT2</entry>
 
277
                        <entry>Value of square root of 2</entry>
 
278
                    </row>
 
279
                    <row>
 
280
                        <entry>M_SQRT1_2</entry>
 
281
                        <entry>Value of 1 / (square root of 2)</entry>
 
282
                    </row>
 
283
                </tbody>
 
284
            </tgroup>
 
285
        </informaltable>
 
286
 
 
287
        <para>
 
288
          The following constants are also available. They are of type <type>half</type> and
 
289
          are accurate within the precision of the <type>half</type> type.  An application that
 
290
          wants to use <type>half</type> and <type>half<replaceable>n</replaceable></type>
 
291
          types will need to include the <code>#pragma OPENCL EXTENSION
 
292
          <citerefentry><refentrytitle>cl_khr_fp16</refentrytitle></citerefentry> : enable</code>
 
293
          directive.
 
294
        </para>
 
295
 
 
296
        <informaltable frame="all">
 
297
            <tgroup cols="2" align="left" colsep="1" rowsep="1">
 
298
                <colspec colname="col1" colnum="1" />
 
299
                <colspec colname="col2" colnum="2" />
 
300
 
 
301
                <thead>
 
302
                    <row>
 
303
                        <entry>Constant</entry>
 
304
                        <entry>Description</entry>
 
305
                    </row>
 
306
                </thead>
 
307
 
 
308
                <tbody>
 
309
                    <row>
 
310
                        <entry>M_E_H</entry>
 
311
                        <entry>Value of e</entry>
 
312
                    </row>
 
313
                    <row>
 
314
                        <entry>M_LOG2E_H</entry>
 
315
                        <entry>Value of log<subscript>2</subscript>e</entry>
 
316
                    </row>
 
317
                    <row>
 
318
                        <entry>M_LOG10E_H</entry>
 
319
                        <entry>Value of log<subscript>10</subscript>e</entry>
 
320
                    </row>
 
321
                    <row>
 
322
                        <entry>M_LN2_H</entry>
 
323
                        <entry>Value of log<subscript>e</subscript>2</entry>
 
324
                    </row>
 
325
                    <row>
 
326
                        <entry>M_LN10_H</entry>
 
327
                        <entry>Value of log<subscript>e</subscript>10</entry>
 
328
                    </row>
 
329
                    <row>
 
330
                        <entry>M_PI_H</entry>
 
331
                        <entry>Value of pi</entry>
 
332
                    </row>
 
333
                    <row>
 
334
                        <entry>M_PI_2_H</entry>
 
335
                        <entry>Value of pi / 2</entry>
 
336
                    </row>
 
337
                    <row>
 
338
                        <entry>M_PI_4_H</entry>
 
339
                        <entry>Value of pi / 4</entry>
 
340
                    </row>
 
341
                    <row>
 
342
                        <entry>M_1_PI_H</entry>
 
343
                        <entry>Value of 1 / pi</entry>
 
344
                    </row>
 
345
                    <row>
 
346
                        <entry>M_2_PI_H</entry>
 
347
                        <entry>Value of 2 / pi</entry>
 
348
                    </row>
 
349
                    <row>
 
350
                        <entry>M_2_SQRTPI_H</entry>
 
351
                        <entry>Value of 2 / (square root of pi)</entry>
 
352
                    </row>
 
353
                    <row>
 
354
                        <entry>M_SQRT2_H</entry>
 
355
                        <entry>Value of square root of 2</entry>
 
356
                    </row>
 
357
                    <row>
 
358
                        <entry>M_SQRT1_2_H</entry>
 
359
                        <entry>Value of 1 / (square root of 2)</entry>
 
360
                    </row>
 
361
                </tbody>
 
362
            </tgroup>
 
363
        </informaltable>
 
364
    </refsect1>
 
365
 
 
366
<!-- ================================ SPECIFICATION  -->
 
367
<!-- Set the "uri" attribute in the <olink /> element to the "named destination" for the PDF page
 
368
-->
 
369
    <refsect1 id="specification"><title>Specification</title>
 
370
        <para>
 
371
            <imageobject>
 
372
                <imagedata fileref="pdficon_small1.gif" format="gif" />
 
373
            </imageobject>
 
374
 
 
375
            <olink uri="mathConstants">OpenCL Specification</olink>
 
376
        </para>
 
377
    </refsect1>
 
378
 
 
379
<!-- ================================ ALSO SEE  -->
 
380
 
 
381
    <refsect1 id="seealso"><title>Also see</title>
 
382
        <para>
 
383
            <citerefentry href="mathFunctions"><refentrytitle>Math Functions</refentrytitle></citerefentry>,
 
384
            <citerefentry href="FP_CONTRACT"><refentrytitle>Floating Point Pragma</refentrytitle></citerefentry>,
 
385
            <citerefentry href="macroLimits"><refentrytitle>Macros and Limits</refentrytitle></citerefentry>
 
386
        </para>
 
387
    </refsect1>
 
388
 
 
389
<!-- ============================== COPYRIGHT -->
 
390
<!-- Content included from copyright.inc.xsl -->
 
391
 
 
392
    <refsect3 id="Copyright"><title></title>
 
393
        <imageobject>
 
394
                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
 
395
        </imageobject>
 
396
        <para />
 
397
    </refsect3>
 
398
 
 
399
<!-- 16-Oct-2011 -->
 
400
</refentry>
 
401