OSDN Git Service

PR fortran/46402
[pf3gnuchains/gcc-fork.git] / libquadmath / libquadmath.texi
1 \input texinfo @c -*-texinfo-*-
2
3 @c %**start of header
4 @setfilename libquadmath.info
5 @settitle GCC libquadmath
6 @c %**end of header
7
8 @copying
9 Copyright @copyright{} 2010 Free Software Foundation, Inc.
10
11 @quotation
12 Permission is granted to copy, distribute and/or modify this document
13 under the terms of the GNU Free Documentation License, Version 1.2 or
14 any later version published by the Free Software Foundation; with no
15 Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,''
16 and with the Back-Cover Texts as in (a) below.  A copy of the
17 license is included in the section entitled ``GNU Free Documentation
18 License.''
19
20 (a) The FSF's Back-Cover Text is: ``You have the freedom to
21 copy and modify this GNU manual.
22 @end quotation
23 @end copying
24
25 @ifinfo
26 @dircategory GNU Libraries
27 @direntry
28 * libquadmath: (libquadmath).                  GCC Quad-Precision Math Library
29 @end direntry
30
31 This manual documents the GCC Quad-Precision Math Library API.
32
33 Published by the Free Software Foundation
34 51 Franklin Street, Fifth Floor
35 Boston, MA 02110-1301 USA
36
37 @insertcopying
38 @end ifinfo
39
40
41 @setchapternewpage odd
42
43 @titlepage
44 @title The GCC Quad-Precision Math Library
45 @page
46 @vskip 0pt plus 1filll
47 @comment For the @value{version-GCC} Version*
48 @sp 1
49 Published by the Free Software Foundation @*
50 51 Franklin Street, Fifth Floor@*
51 Boston, MA 02110-1301, USA@*
52 @sp 1
53 @insertcopying
54 @end titlepage
55
56 @summarycontents
57 @contents
58 @page
59
60
61 @node Top
62 @top Introduction
63 @cindex Introduction
64
65 This manual documents the usage of libquadmath, the GCC Quad-Precision
66 Math Library Application Programming Interface (API).
67
68
69 @comment
70 @comment  When you add a new menu item, please keep the right hand
71 @comment  aligned to the same column.  Do not use tabs.  This provides
72 @comment  better formatting.
73 @comment
74 @menu
75 * Math Library Routines::      The Libquadmath math runtime application
76                                programming interface.
77 * I/O Library Routines::       The Libquadmath I/O runtime application
78                                programming interface.
79 * GNU Free Documentation License::
80                                How you can copy and share this manual.
81 * Reporting Bugs::             How to report bugs in GCC Libquadmath.
82 @c * Index::                      Index of this documentation.
83 @end menu
84
85
86 @c ---------------------------------------------------------------------
87 @c Math routines
88 @c ---------------------------------------------------------------------
89
90 @node Math Library Routines
91 @chapter Math Library Routines
92
93 The following mathematical functions are available:
94
95 @table @asis
96 @item @code{acosq}: arc cosine function
97 @item @code{acoshq}: inverse hyperbolic cosine function
98 @item @code{asinq}: arc sine function
99 @item @code{asinhq}: inverse hyperbolic sine function
100 @item @code{atanq}: arc tangent function
101 @item @code{atanhq}: inverse hyperbolic tangent function
102 @item @code{atan2q}: arc tangent function
103 @item @code{cbrtq}: cube root function
104 @item @code{ceilq}: ceiling value function
105 @item @code{copysignq}: copy sign of a number
106 @item @code{coshq}: hyperbolic cosine function
107 @item @code{cosq}: cosine function
108 @item @code{erfq}: error function
109 @item @code{erfcq}: complementary error function
110 @item @code{expq}: exponential function
111 @item @code{expm1q}: exponential minus 1 function
112 @need 800
113 @item @code{fabsq}: absolute value function
114 @item @code{finiteq}: check finiteness of value
115 @item @code{floorq}: floor value function
116 @item @code{fmaq}: fused multiply and add
117 @item @code{fmodq}: remainder value function
118 @item @code{frexpq}: extract mantissa and exponent
119 @item @code{hypotq}: Eucledian distance function
120 @item @code{isinfq}: check for infinity
121 @item @code{isnanq}: check for not a number
122 @item @code{j0q}: Bessel function of the first kind, first order
123 @item @code{j1q}: Bessel function of the first kind, second order
124 @item @code{jnq}: Bessel function of the first kind, @var{n}-th order
125 @item @code{ldexpq}: load exponent of the value
126 @item @code{lgammaq}: logarithmic gamma function
127 @item @code{llroundq}: round to nearest integer value away from zero
128 @item @code{logq}: natural logarithm function
129 @item @code{log10q}: base 10 logarithm function
130 @item @code{log1pq}: compute natural logarithm of the value plus one
131 @need 800
132 @item @code{lroundq}: round to nearest integer value away from zero
133 @item @code{modfq}: decompose the floating-point number
134 @item @code{nanq}: return quiet NaN
135 @item @code{nextafterq}: next representable floating-point number
136 @item @code{powq}: power function
137 @item @code{remainderq}: remainder function
138 @item @code{rintq}: round-to-nearest integral value
139 @item @code{roundq}: round-to-nearest integral value, return @code{__float128}
140 @item @code{scalblnq}: compute exponent using @code{FLT_RADIX}
141 @item @code{scalbnq}: compute exponent using @code{FLT_RADIX}
142 @item @code{signbitq}: return sign bit
143 @item @code{sincosq}: calculate sine and cosine simulataneously
144 @item @code{sinhq}: hyperbolic sine function
145 @item @code{sinq}: sine function
146 @item @code{sqrtq}: square root function
147 @item @code{tanq}: tangent function
148 @item @code{tanhq}: hyperbolic tangent function
149 @need 800
150 @item @code{tgammaq}: true gamma function
151 @item @code{truncq}: round to integer, towards zero
152 @item @code{y0q}: Bessel function of the second kind, first order
153 @item @code{y1q}: Bessel function of the second kind, second order
154 @item @code{ynq}: Bessel function of the second kind, @var{n}-th order
155 @item @code{cabsq} complex absolute value function:
156 @item @code{cargq}: calculate the argument
157 @item @code{ccosq} complex cosine function:
158 @item @code{ccoshq}: complex hyperbolic cosine function
159 @item @code{cexpq}: complex exponential function
160 @item @code{cexpiq}: computes the exponential function of ``i'' times a
161                      real value
162 @item @code{clogq}: complex natural logarithm
163 @item @code{clog10q}: complex base 10 logarithm
164 @item @code{cpowq}: complex power function
165 @item @code{csinq}: complex sine function
166 @item @code{csinhq}: complex hyperbolic sine function
167 @need 800
168 @item @code{csqrtq}: complex square root
169 @item @code{ctanq}: complex tangent function
170 @item @code{ctanhq}: complex hyperbolic tangent function
171 @end table
172
173
174 @c ---------------------------------------------------------------------
175 @c I/O routines
176 @c ---------------------------------------------------------------------
177
178 @node I/O Library Routines
179 @chapter I/O Library Routines
180
181 @menu
182 * @code{quadmath_strtopQ}:  quadmath_strtopQ,  Convert from string
183 * @code{quadmath_dtoaq}:    quadmath_dtoaq,    Convert to string
184 @end menu
185
186
187 @node quadmath_strtopQ
188 @section @code{quadmath_strtopQ} --- Convert from string
189
190 The function @code{dmath_strtopQ} converts a string into a
191 @code{__float128} number.
192
193 @table @asis
194 @item Syntax
195 @code{int quadmath_strtopQ (const char *s, char **sp, void *V)}
196
197 @c The return values are defined in gdtoa/gdtoa.h STRTOG_*
198 @c However, the values are currently not exported - thus we
199 @c do not define them here, either.
200
201 @item @emph{Arguments}:
202 @multitable @columnfractions .15 .70
203 @item @var{s}  @tab input string
204 @item @var{sp} @tab the address of the next character in the string
205 @item @var{V}  @tab @code{__float128} containing the converted number
206 @end multitable
207
208 The argument @var{sp} contains, if not @code{NULL}, the address of the
209 next character following the parts of the string, which have been read.
210
211 @item Example
212 @smallexample
213 #include <quadmath.h>
214
215 int main ()
216 @{
217   __float128 r;
218   char str[200];
219
220   quadmath_strtopQ ("1.2345678", NULL, &r);
221
222   return 0;
223 @}
224 @end smallexample
225 @end table
226
227
228 @node quadmath_dtoaq
229 @section @code{quadmath_dtoaq} --- Convert to string
230
231 The function @code{quadmath_dtoaq} converts a @code{__float128} floating-point
232 number into a string.
233
234 @table @asis
235 @item Syntax
236 @code{void quadmath_dtoaq (char *s, size_t size, size_t n, __float128 x)}
237
238 @item @emph{Arguments}:
239 @multitable @columnfractions .15 .70
240 @item @var{s}    @tab output string
241 @item @var{size} @tab byte size of the string, including tailing NUL
242 @item @var{n}    @tab number of digits after the decimal point
243 @item @var{x}    @tab the number to be converted
244 @end multitable
245
246 @item Example
247 @smallexample
248 #include <quadmath.h>
249
250 int main ()
251 @{
252   __float128 r;
253   char str[200];
254
255   r = 2.0q;
256   r = sqrtq(r);
257   quadmath_dtoaq (str, sizeof (str), 20, r);
258   printf("%s\n", str);
259   /* Prints: +1.41421356237309504880e+00 */
260   return 0;
261 @}
262 @end smallexample
263 @end table
264
265
266 @c ---------------------------------------------------------------------
267 @c GNU Free Documentation License
268 @c ---------------------------------------------------------------------
269
270 @include fdl.texi
271
272 @c ---------------------------------------------------------------------
273 @c Reporting Bugs
274 @c ---------------------------------------------------------------------
275
276 @c For BUGURL
277 @include libquadmath-vers.texi
278
279 @node Reporting Bugs
280 @chapter Reporting Bugs
281
282 Bugs in the GCC Quad-Precision Math Library implementation should be
283 reported via @value{BUGURL}.
284
285
286 @c ---------------------------------------------------------------------
287 @c Index
288 @c ---------------------------------------------------------------------
289
290 @c @node Index
291 @c @unnumbered Index
292 @c 
293 @c @printindex cp
294
295 @bye