This manual documents the GCC Quad-Precision Math Library API.

Published by the Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA

Copyright © 2010 Free Software Foundation, Inc.

     Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being ``A GNU Manual,'' and with the Back-Cover Texts as in (a) below.  A copy of the license is included in the section entitled ``GNU Free Documentation License.''

     (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and modify this GNU manual.

Introduction
************

This manual documents the usage of libquadmath, the GCC Quad-Precision Math Library Application Programming Interface (API).

Math Library Routines
*********************

The following mathematical functions are available:

acosq: arc cosine function

acoshq: inverse hyperbolic cosine function

asinq: arc sine function

asinhq: inverse hyperbolic sine function

atanq: arc tangent function

atanhq: inverse hyperbolic tangent function

atan2q: arc tangent function

cbrtq: cube root function

ceilq: ceiling value function

copysignq: copy sign of a number

coshq: hyperbolic cosine function

cosq: cosine function

erfq: error function

erfcq: complementary error function

expq: exponential function

expm1q: exponential minus 1 function

fabsq: absolute value function

finiteq: check finiteness of value

floorq: floor value function

fmodq: remainder value function

frexpq: extract mantissa and exponent

hypotq: Eucledian distance function

isinfq: check for infinity

isnanq: check for not a number

j0q: Bessel function of the first kind, first order

j1q: Bessel function of the first kind, second order

jnq: Bessel function of the first kind, N-th order

ldexpq: load exponent of the value

lgammaq: logarithmic gamma function

llroundq: round to nearest integer value away from zero

logq: natural logarithm function

log10q: base 10 logarithm function

log1pq: compute natural logarithm of the value plus one

lroundq: round to nearest integer value away from zero

modfq: decompose the floating-point number

nanq: return quiet NaN

nextafterq: next representable floating-point number

powq: power function

remainderq: remainder function

rintq: round-to-nearest integral value

roundq: round-to-nearest integral value, return __float128

scalblnq: compute exponent using FLT_RADIX

scalbnq: compute exponent using FLT_RADIX

signbitq: return sign bit

sincosq: calculate sine and cosine simulataneously

sinhq: hyperbolic sine function

sinq: sine function

sqrtq: square root function

tanq: tangent function

tanhq: hyperbolic tangent function

tgammaq: true gamma function

truncq: round to integer, towards zero

y0q: Bessel function of the second kind, first order

y1q: Bessel function of the second kind, second order

ynq: Bessel function of the second kind, N-th order

cabsq complex absolute value function:

cargq: calculate the argument

ccosq complex cosine function:

ccoshq: complex hyperbolic cosine function

cexpq: complex exponential function

cexpiq: computes the exponential function of ``i'' times a
     real value

clogq: complex natural logarithm

clog10q: complex base 10 logarithm

cpowq: complex power function

csinq: complex sine function

csinhq: complex hyperbolic sine function

csqrtq: complex square root

ctanq: complex tangent function

ctanhq: complex hyperbolic tangent function

I/O Library Routines
********************

quadmath_strtopQ --- Convert from string
========================================

The function dmath_strtopQ converts a string into a __float128 number.

Syntax
     int quadmath_strtopQ (const char *s, char **sp, void *V)

Arguments:

     S    input string
     SP   the address of the next character in the string
     V    __float128 containing the converted number

     The argument SP contains, if not NULL, the address of the next character following the parts of the string, which have been read.

Example

          #include <quadmath.h>

          int main ()
          {
            __float128 r;
            char str[200];

            quadmath_strtopQ ("1.2345678", NULL, &r);

            return 0;
          }

quadmath_dtoaq --- Convert to string
====================================

The function quadmath_dtoaq converts a __float128 floating-point number into a string.

Syntax
     void quadmath_dtoaq (char *s, size_t size, size_t n, __float128 x)

Arguments:

     S      output string
     SIZE   byte size of the string, including tailing NUL
     N      number of digits after the decimal point
     X      the number to be converted

Example

          #include <quadmath.h>

          int main ()
          {
            __float128 r;
            char str[200];

            r = 2.0q;
            r = sqrtq(r);
            quadmath_dtoaq (str, sizeof (str), 20, r);
            printf("%s\n", str);
            /* Prints: +1.41421356237309504880e+00 */
            return 0;
          }

     [file fdl.texi not included]

     [file libquadmath-vers.texi not included]

Reporting Bugs
**************

Bugs in the GCC Quad-Precision Math Library implementation should be reported via BUGURL.