re PR libstdc++/47320 (FAIL: 18_support/numeric_limits/lowest.cc execution test)
[official-gcc.git] / libquadmath / libquadmath.texi
blob3dbbe5d63806b15fc38207c3581c53cd732687e5
1 \input texinfo @c -*-texinfo-*-
3 @c %**start of header
4 @setfilename libquadmath.info
5 @settitle GCC libquadmath
6 @c %**end of header
8 @copying
9 Copyright @copyright{} 2010 Free Software Foundation, Inc.
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.''
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
25 @ifinfo
26 @dircategory GNU Libraries
27 @direntry
28 * libquadmath: (libquadmath).                  GCC Quad-Precision Math Library
29 @end direntry
31 This manual documents the GCC Quad-Precision Math Library API.
33 Published by the Free Software Foundation
34 51 Franklin Street, Fifth Floor
35 Boston, MA 02110-1301 USA
37 @insertcopying
38 @end ifinfo
41 @setchapternewpage odd
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
56 @summarycontents
57 @contents
58 @page
61 @node Top
62 @top Introduction
63 @cindex Introduction
65 This manual documents the usage of libquadmath, the GCC Quad-Precision
66 Math Library Application Programming Interface (API).
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
86 @c ---------------------------------------------------------------------
87 @c Math routines
88 @c ---------------------------------------------------------------------
90 @node Math Library Routines
91 @chapter Math Library Routines
93 The following mathematical functions are available:
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{fdimq}: positive difference function
115 @item @code{finiteq}: check finiteness of value
116 @item @code{floorq}: floor value function
117 @item @code{fmaq}: fused multiply and add
118 @item @code{fmaxq}: determine maximum of two values
119 @item @code{fminq}: determine minimum of two values
120 @item @code{fmodq}: remainder value function
121 @item @code{frexpq}: extract mantissa and exponent
122 @item @code{hypotq}: Eucledian distance function
123 @item @code{ilogbq}: get exponent of the value
124 @item @code{isinfq}: check for infinity
125 @item @code{isnanq}: check for not a number
126 @item @code{j0q}: Bessel function of the first kind, first order
127 @item @code{j1q}: Bessel function of the first kind, second order
128 @item @code{jnq}: Bessel function of the first kind, @var{n}-th order
129 @item @code{ldexpq}: load exponent of the value
130 @item @code{lgammaq}: logarithmic gamma function
131 @item @code{llrintq}: round to nearest integer value
132 @item @code{llroundq}: round to nearest integer value away from zero
133 @item @code{logq}: natural logarithm function
134 @item @code{log10q}: base 10 logarithm function
135 @item @code{log1pq}: compute natural logarithm of the value plus one
136 @item @code{log2q}: base 2 logarithm function
137 @need 800
138 @item @code{lrintq}: round to nearest integer value
139 @item @code{lroundq}: round to nearest integer value away from zero
140 @item @code{modfq}: decompose the floating-point number
141 @item @code{nanq}: return quiet NaN
142 @item @code{nearbyintq}: round to nearest integer
143 @item @code{nextafterq}: next representable floating-point number
144 @item @code{powq}: power function
145 @item @code{remainderq}: remainder function
146 @item @code{remquoq}: remainder and part of quotient
147 @item @code{rintq}: round-to-nearest integral value
148 @item @code{roundq}: round-to-nearest integral value, return @code{__float128}
149 @item @code{scalblnq}: compute exponent using @code{FLT_RADIX}
150 @item @code{scalbnq}: compute exponent using @code{FLT_RADIX}
151 @item @code{signbitq}: return sign bit
152 @item @code{sincosq}: calculate sine and cosine simulataneously
153 @item @code{sinhq}: hyperbolic sine function
154 @item @code{sinq}: sine function
155 @item @code{sqrtq}: square root function
156 @item @code{tanq}: tangent function
157 @item @code{tanhq}: hyperbolic tangent function
158 @need 800
159 @item @code{tgammaq}: true gamma function
160 @item @code{truncq}: round to integer, towards zero
161 @item @code{y0q}: Bessel function of the second kind, first order
162 @item @code{y1q}: Bessel function of the second kind, second order
163 @item @code{ynq}: Bessel function of the second kind, @var{n}-th order
164 @item @code{cabsq} complex absolute value function
165 @item @code{cargq}: calculate the argument
166 @item @code{cimagq} imaginary part of complex number
167 @item @code{crealq}: real part of complex number
168 @item @code{cacoshq}: complex arc hyperbolic cosine function
169 @item @code{cacosq}: complex arc cosine function
170 @item @code{casinhq}: complex arc hyperbolic sine function
171 @item @code{casinq}: complex arc sine function
172 @item @code{catanhq}: complex arc hyperbolic tangent function
173 @item @code{catanq}: complex arc tangent function
174 @item @code{ccosq} complex cosine function:
175 @item @code{ccoshq}: complex hyperbolic cosine function
176 @item @code{cexpq}: complex exponential function
177 @need 800
178 @item @code{cexpiq}: computes the exponential function of ``i'' times a
179                      real value
180 @item @code{clogq}: complex natural logarithm
181 @item @code{clog10q}: complex base 10 logarithm
182 @item @code{conjq}: complex conjugate function
183 @item @code{cpowq}: complex power function
184 @item @code{cprojq}: project into Riemann Sphere
185 @item @code{csinq}: complex sine function
186 @item @code{csinhq}: complex hyperbolic sine function
187 @item @code{csqrtq}: complex square root
188 @item @code{ctanq}: complex tangent function
189 @item @code{ctanhq}: complex hyperbolic tangent function
190 @end table
193 @c ---------------------------------------------------------------------
194 @c I/O routines
195 @c ---------------------------------------------------------------------
197 @node I/O Library Routines
198 @chapter I/O Library Routines
200 @menu
201 * @code{strtoflt128}:          strtoflt128,          Convert from string
202 * @code{quadmath_flt128tostr}: quadmath_flt128tostr, Convert to string
203 @end menu
206 @node strtoflt128
207 @section @code{strtoflt128} --- Convert from string
209 The function @code{dmath_strtopQ} converts a string into a
210 @code{__float128} number.
212 @table @asis
213 @item Syntax
214 @code{__float128 strtoflt128 (const char *s, char **sp)}
216 @c The return values are defined in gdtoa/gdtoa.h STRTOG_*
217 @c However, the values are currently not exported - thus we
218 @c do not define them here, either.
220 @item @emph{Arguments}:
221 @multitable @columnfractions .15 .70
222 @item @var{s}  @tab input string
223 @item @var{sp} @tab the address of the next character in the string
224 @end multitable
226 The argument @var{sp} contains, if not @code{NULL}, the address of the
227 next character following the parts of the string, which have been read.
229 @item Example
230 @smallexample
231 #include <quadmath.h>
233 int main ()
235   __float128 r;
237   r = strtoflt128 ("1.2345678", NULL);
239   return 0;
241 @end smallexample
242 @end table
245 @node quadmath_flt128tostr
246 @section @code{quadmath_flt128tostr} --- Convert to string
248 The function @code{quadmath_flt128tostr} converts a @code{__float128} floating-point
249 number into a string.
251 @table @asis
252 @item Syntax
253 @code{void quadmath_flt128tostr (char *s, size_t size, size_t n, __float128 x)}
255 @item @emph{Arguments}:
256 @multitable @columnfractions .15 .70
257 @item @var{s}    @tab output string
258 @item @var{size} @tab byte size of the string, including tailing NUL
259 @item @var{n}    @tab number of digits after the decimal point
260 @item @var{x}    @tab the number to be converted
261 @end multitable
263 @item Example
264 @smallexample
265 #include <quadmath.h>
267 int main ()
269   __float128 r;
270   char str[200];
272   r = 2.0q;
273   r = sqrtq(r);
274   quadmath_flt128tostr (str, sizeof (str), 20, r);
275   printf("%s\n", str);
276   /* Prints: +1.41421356237309504880e+00 */
277   return 0;
279 @end smallexample
280 @end table
283 @c ---------------------------------------------------------------------
284 @c GNU Free Documentation License
285 @c ---------------------------------------------------------------------
287 @include fdl.texi
289 @c ---------------------------------------------------------------------
290 @c Reporting Bugs
291 @c ---------------------------------------------------------------------
293 @c For BUGURL
294 @include libquadmath-vers.texi
296 @node Reporting Bugs
297 @chapter Reporting Bugs
299 Bugs in the GCC Quad-Precision Math Library implementation should be
300 reported via @value{BUGURL}.
303 @c ---------------------------------------------------------------------
304 @c Index
305 @c ---------------------------------------------------------------------
307 @c @node Index
308 @c @unnumbered Index
309 @c 
310 @c @printindex cp
312 @bye