diff options
| author | Mike Frysinger <vapier@gentoo.org> | 2022-02-14 20:53:44 -0500 |
|---|---|---|
| committer | Corinna Vinschen <vinschen@redhat.com> | 2022-02-17 13:06:50 +0100 |
| commit | 535250169b4b7cda0c21d2215353fffa1a6b09ca (patch) | |
| tree | 462a35cad9733d08c9b64f043e2cb44930ccc202 /libm.html | |
| parent | add libgloss manual from current git (diff) | |
refresh libc & libm manual from current git
Diffstat (limited to 'libm.html')
| -rw-r--r-- | libm.html | 2764 |
1 files changed, 1373 insertions, 1391 deletions
| @@ -1,7 +1,8 @@ | |||
| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 | <html> | 2 | <html> |
| 3 | <!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ --> | 3 | <!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ --> |
| 4 | <head> | 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
| 5 | <title>LIBM</title> | 6 | <title>LIBM</title> |
| 6 | 7 | ||
| 7 | <meta name="description" content="LIBM"> | 8 | <meta name="description" content="LIBM"> |
| @@ -9,36 +10,28 @@ | |||
| 9 | <meta name="resource-type" content="document"> | 10 | <meta name="resource-type" content="document"> |
| 10 | <meta name="distribution" content="global"> | 11 | <meta name="distribution" content="global"> |
| 11 | <meta name="Generator" content="makeinfo"> | 12 | <meta name="Generator" content="makeinfo"> |
| 12 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | 13 | <meta name="viewport" content="width=device-width,initial-scale=1"> |
| 14 | |||
| 13 | <link href="#Top" rel="start" title="Top"> | 15 | <link href="#Top" rel="start" title="Top"> |
| 14 | <link href="#Document-Index" rel="index" title="Document Index"> | 16 | <link href="#Document-Index" rel="index" title="Document Index"> |
| 15 | <link href="#SEC_Contents" rel="contents" title="Table of Contents"> | 17 | <link href="#SEC_Contents" rel="contents" title="Table of Contents"> |
| 16 | <link href="dir.html#Top" rel="up" title="(dir)"> | 18 | <link href="#Math" rel="next" title="Math"> |
| 17 | <style type="text/css"> | 19 | <style type="text/css"> |
| 18 | <!-- | 20 | <!-- |
| 21 | a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em} | ||
| 19 | a.summary-letter {text-decoration: none} | 22 | a.summary-letter {text-decoration: none} |
| 20 | blockquote.smallquotation {font-size: smaller} | 23 | blockquote.indentedblock {margin-right: 0em} |
| 21 | div.display {margin-left: 3.2em} | 24 | div.display {margin-left: 3.2em} |
| 22 | div.example {margin-left: 3.2em} | 25 | div.example {margin-left: 3.2em} |
| 23 | div.indentedblock {margin-left: 3.2em} | 26 | kbd {font-style: oblique} |
| 24 | div.lisp {margin-left: 3.2em} | ||
| 25 | div.smalldisplay {margin-left: 3.2em} | ||
| 26 | div.smallexample {margin-left: 3.2em} | ||
| 27 | div.smallindentedblock {margin-left: 3.2em; font-size: smaller} | ||
| 28 | div.smalllisp {margin-left: 3.2em} | ||
| 29 | kbd {font-style:oblique} | ||
| 30 | pre.display {font-family: inherit} | 27 | pre.display {font-family: inherit} |
| 31 | pre.format {font-family: inherit} | 28 | pre.format {font-family: inherit} |
| 32 | pre.menu-comment {font-family: serif} | 29 | pre.menu-comment {font-family: serif} |
| 33 | pre.menu-preformatted {font-family: serif} | 30 | pre.menu-preformatted {font-family: serif} |
| 34 | pre.smalldisplay {font-family: inherit; font-size: smaller} | 31 | span.nolinebreak {white-space: nowrap} |
| 35 | pre.smallexample {font-size: smaller} | 32 | span.roman {font-family: initial; font-weight: normal} |
| 36 | pre.smallformat {font-family: inherit; font-size: smaller} | 33 | span.sansserif {font-family: sans-serif; font-weight: normal} |
| 37 | pre.smalllisp {font-size: smaller} | 34 | span:hover a.copiable-anchor {visibility: visible} |
| 38 | span.nocodebreak {white-space:nowrap} | ||
| 39 | span.nolinebreak {white-space:nowrap} | ||
| 40 | span.roman {font-family:serif; font-weight:normal} | ||
| 41 | span.sansserif {font-family:sans-serif; font-weight:normal} | ||
| 42 | ul.no-bullet {list-style: none} | 35 | ul.no-bullet {list-style: none} |
| 43 | --> | 36 | --> |
| 44 | </style> | 37 | </style> |
| @@ -46,231 +39,241 @@ ul.no-bullet {list-style: none} | |||
| 46 | 39 | ||
| 47 | </head> | 40 | </head> |
| 48 | 41 | ||
| 49 | <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> | 42 | <body lang="en"> |
| 50 | 43 | ||
| 51 | 44 | ||
| 52 | 45 | ||
| 53 | <a name="Top"></a> | 46 | <div class="top" id="Top"> |
| 54 | <div class="header"> | 47 | <div class="header"> |
| 55 | <p> | 48 | <p> |
| 56 | Next: <a href="#Math" accesskey="n" rel="next">Math</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 49 | Next: <a href="#Math" accesskey="n" rel="next">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 57 | </div> | 50 | </div> |
| 58 | <a name="LIBM"></a> | 51 | <span id="LIBM"></span><h1 class="top">LIBM</h1> |
| 59 | <h1 class="top">LIBM</h1> | ||
| 60 | 52 | ||
| 61 | <table class="menu" border="0" cellspacing="0"> | ||
| 62 | <tr><td align="left" valign="top">• <a href="#Math" accesskey="1">Math</a>:</td><td> </td><td align="left" valign="top">The mathematical functions (‘math.h’). | ||
| 63 | </td></tr> | ||
| 64 | <tr><td align="left" valign="top">• <a href="#Complex" accesskey="2">Complex</a>:</td><td> </td><td align="left" valign="top">The mathematical complex functions (‘complex.h’). | ||
| 65 | </td></tr> | ||
| 66 | <tr><td align="left" valign="top">• <a href="#Reentrancy" accesskey="3">Reentrancy</a>:</td><td> </td><td align="left" valign="top">The functions in libm are not reentrant by default. | ||
| 67 | </td></tr> | ||
| 68 | <tr><td align="left" valign="top">• <a href="#Long-Double-Functions" accesskey="4">Long Double Functions</a>:</td><td> </td><td align="left" valign="top">The long double function support of libm. | ||
| 69 | </td></tr> | ||
| 70 | <tr><td align="left" valign="top">• <a href="#Document-Index" accesskey="5">Document Index</a>:</td><td> </td><td align="left" valign="top"> | ||
| 71 | </td></tr> | ||
| 72 | </table> | ||
| 73 | 53 | ||
| 54 | <div class="Contents_element" id="SEC_Contents"> | ||
| 55 | <h2 class="contents-heading">Table of Contents</h2> | ||
| 56 | |||
| 57 | <div class="contents"> | ||
| 58 | |||
| 59 | <ul class="no-bullet"> | ||
| 60 | <li><a id="toc-Mathematical-Functions-_0028math_002eh_0029" href="#Math">1 Mathematical Functions (<samp>math.h</samp>)</a> | ||
| 61 | <ul class="no-bullet"> | ||
| 62 | <li><a id="toc-Error-Handling" href="#version">1.1 Error Handling</a></li> | ||
| 63 | <li><a id="toc-Standards-Compliance-And-Portability" href="#Standards-Compliance-And-Portability">1.2 Standards Compliance And Portability</a></li> | ||
| 64 | <li><a id="toc-acos_002c-acosf_002d_002d_002darc-cosine" href="#acos">1.3 <code>acos</code>, <code>acosf</code>—arc cosine</a></li> | ||
| 65 | <li><a id="toc-acosh_002c-acoshf_002d_002d_002dinverse-hyperbolic-cosine" href="#acosh">1.4 <code>acosh</code>, <code>acoshf</code>—inverse hyperbolic cosine</a></li> | ||
| 66 | <li><a id="toc-asin_002c-asinf_002d_002d_002darc-sine" href="#asin">1.5 <code>asin</code>, <code>asinf</code>—arc sine</a></li> | ||
| 67 | <li><a id="toc-asinh_002c-asinhf_002d_002d_002dinverse-hyperbolic-sine" href="#asinh">1.6 <code>asinh</code>, <code>asinhf</code>—inverse hyperbolic sine</a></li> | ||
| 68 | <li><a id="toc-atan_002c-atanf_002d_002d_002darc-tangent" href="#atan">1.7 <code>atan</code>, <code>atanf</code>—arc tangent</a></li> | ||
| 69 | <li><a id="toc-atan2_002c-atan2f_002d_002d_002darc-tangent-of-y_002fx" href="#atan2">1.8 <code>atan2</code>, <code>atan2f</code>—arc tangent of y/x</a></li> | ||
| 70 | <li><a id="toc-atanh_002c-atanhf_002d_002d_002dinverse-hyperbolic-tangent" href="#atanh">1.9 <code>atanh</code>, <code>atanhf</code>—inverse hyperbolic tangent</a></li> | ||
| 71 | <li><a id="toc-jN_002c-jNf_002c-yN_002c-yNf_002d_002d_002dBessel-functions" href="#jN">1.10 <code>jN</code>, <code>jNf</code>, <code>yN</code>, <code>yNf</code>—Bessel functions</a></li> | ||
| 72 | <li><a id="toc-cbrt_002c-cbrtf_002d_002d_002dcube-root" href="#cbrt">1.11 <code>cbrt</code>, <code>cbrtf</code>—cube root</a></li> | ||
| 73 | <li><a id="toc-copysign_002c-copysignf_002d_002d_002dsign-of-y_002c-magnitude-of-x" href="#copysign">1.12 <code>copysign</code>, <code>copysignf</code>—sign of <var>y</var>, magnitude of <var>x</var></a></li> | ||
| 74 | <li><a id="toc-cosh_002c-coshf_002d_002d_002dhyperbolic-cosine" href="#cosh">1.13 <code>cosh</code>, <code>coshf</code>—hyperbolic cosine</a></li> | ||
| 75 | <li><a id="toc-erf_002c-erff_002c-erfc_002c-erfcf_002d_002d_002derror-function" href="#erf">1.14 <code>erf</code>, <code>erff</code>, <code>erfc</code>, <code>erfcf</code>—error function</a></li> | ||
| 76 | <li><a id="toc-exp_002c-expf_002d_002d_002dexponential" href="#exp">1.15 <code>exp</code>, <code>expf</code>—exponential</a></li> | ||
| 77 | <li><a id="toc-exp10_002c-exp10f_002d_002d_002dexponential_002c-base-10" href="#exp10">1.16 <code>exp10</code>, <code>exp10f</code>—exponential, base 10</a></li> | ||
| 78 | <li><a id="toc-exp2_002c-exp2f_002d_002d_002dexponential_002c-base-2" href="#exp2">1.17 <code>exp2</code>, <code>exp2f</code>—exponential, base 2</a></li> | ||
| 79 | <li><a id="toc-expm1_002c-expm1f_002d_002d_002dexponential-minus-1" href="#expm1">1.18 <code>expm1</code>, <code>expm1f</code>—exponential minus 1</a></li> | ||
| 80 | <li><a id="toc-fabs_002c-fabsf_002d_002d_002dabsolute-value-_0028magnitude_0029" href="#fabs">1.19 <code>fabs</code>, <code>fabsf</code>—absolute value (magnitude)</a></li> | ||
| 81 | <li><a id="toc-fdim_002c-fdimf_002d_002d_002dpositive-difference" href="#fdim">1.20 <code>fdim</code>, <code>fdimf</code>—positive difference</a></li> | ||
| 82 | <li><a id="toc-floor_002c-floorf_002c-ceil_002c-ceilf_002d_002d_002dfloor-and-ceiling" href="#floor">1.21 <code>floor</code>, <code>floorf</code>, <code>ceil</code>, <code>ceilf</code>—floor and ceiling</a></li> | ||
| 83 | <li><a id="toc-fma_002c-fmaf_002d_002d_002dfloating-multiply-add" href="#fma">1.22 <code>fma</code>, <code>fmaf</code>—floating multiply add</a></li> | ||
| 84 | <li><a id="toc-fmax_002c-fmaxf_002d_002d_002dmaximum" href="#fmax">1.23 <code>fmax</code>, <code>fmaxf</code>—maximum</a></li> | ||
| 85 | <li><a id="toc-fmin_002c-fminf_002d_002d_002dminimum" href="#fmin">1.24 <code>fmin</code>, <code>fminf</code>—minimum</a></li> | ||
| 86 | <li><a id="toc-fmod_002c-fmodf_002d_002d_002dfloating_002dpoint-remainder-_0028modulo_0029" href="#fmod">1.25 <code>fmod</code>, <code>fmodf</code>—floating-point remainder (modulo)</a></li> | ||
| 87 | <li><a id="toc-frexp_002c-frexpf_002d_002d_002dsplit-floating_002dpoint-number" href="#frexp">1.26 <code>frexp</code>, <code>frexpf</code>—split floating-point number</a></li> | ||
| 88 | <li><a id="toc-gamma_002c-gammaf_002c-lgamma_002c-lgammaf_002c-gamma_005fr_002c-gammaf_005fr_002c-lgamma_005fr_002c-lgammaf_005fr_002c-tgamma_002c-and-tgammaf_002d_002d_002dlogarithmic-and-plain-gamma-functions" href="#gamma">1.27 <code>gamma</code>, <code>gammaf</code>, <code>lgamma</code>, <code>lgammaf</code>, <code>gamma_r</code>, <code>gammaf_r</code>, <code>lgamma_r</code>, <code>lgammaf_r</code>, <code>tgamma</code>, and <code>tgammaf</code>—logarithmic and plain gamma functions</a></li> | ||
| 89 | <li><a id="toc-hypot_002c-hypotf_002d_002d_002ddistance-from-origin" href="#hypot">1.28 <code>hypot</code>, <code>hypotf</code>—distance from origin</a></li> | ||
| 90 | <li><a id="toc-ilogb_002c-ilogbf_002d_002d_002dget-exponent-of-floating_002dpoint-number" href="#ilogb">1.29 <code>ilogb</code>, <code>ilogbf</code>—get exponent of floating-point number</a></li> | ||
| 91 | <li><a id="toc-infinity_002c-infinityf_002d_002d_002drepresentation-of-infinity" href="#infinity">1.30 <code>infinity</code>, <code>infinityf</code>—representation of infinity</a></li> | ||
| 92 | <li><a id="toc-isgreater_002c-isgreaterequal_002c-isless_002c-islessequal_002c-islessgreater_002c-and-isunordered_002d_002d_002dcomparison-macros" href="#isgreater">1.31 <code>isgreater</code>, <code>isgreaterequal</code>, <code>isless</code>, <code>islessequal</code>, <code>islessgreater</code>, and <code>isunordered</code>—comparison macros</a></li> | ||
| 93 | <li><a id="toc-fpclassify_002c-isfinite_002c-isinf_002c-isnan_002c-and-isnormal_002d_002d_002dfloating_002dpoint-classification-macros_003b-finite_002c-finitef_002c-isinf_002c-isinff_002c-isnan_002c-isnanf_002d_002d_002dtest-for-exceptional-numbers" href="#fpclassify">1.32 <code>fpclassify</code>, <code>isfinite</code>, <code>isinf</code>, <code>isnan</code>, and <code>isnormal</code>—floating-point classification macros; <code>finite</code>, <code>finitef</code>, <code>isinf</code>, <code>isinff</code>, <code>isnan</code>, <code>isnanf</code>—test for exceptional numbers</a></li> | ||
| 94 | <li><a id="toc-ldexp_002c-ldexpf_002d_002d_002dload-exponent" href="#ldexp">1.33 <code>ldexp</code>, <code>ldexpf</code>—load exponent</a></li> | ||
| 95 | <li><a id="toc-log_002c-logf_002d_002d_002dnatural-logarithms" href="#log">1.34 <code>log</code>, <code>logf</code>—natural logarithms</a></li> | ||
| 96 | <li><a id="toc-log10_002c-log10f_002d_002d_002dbase-10-logarithms" href="#log10">1.35 <code>log10</code>, <code>log10f</code>—base 10 logarithms</a></li> | ||
| 97 | <li><a id="toc-log1p_002c-log1pf_002d_002d_002dlog-of-1-_002b-x" href="#log1p">1.36 <code>log1p</code>, <code>log1pf</code>—log of <code>1 + <var>x</var></code></a></li> | ||
| 98 | <li><a id="toc-log2_002c-log2f_002d_002d_002dbase-2-logarithm" href="#log2">1.37 <code>log2</code>, <code>log2f</code>—base 2 logarithm</a></li> | ||
| 99 | <li><a id="toc-logb_002c-logbf_002d_002d_002dget-exponent-of-floating_002dpoint-number" href="#logb">1.38 <code>logb</code>, <code>logbf</code>—get exponent of floating-point number</a></li> | ||
| 100 | <li><a id="toc-lrint_002c-lrintf_002c-llrint_002c-llrintf_002d_002d_002dround-to-integer" href="#lrint">1.39 <code>lrint</code>, <code>lrintf</code>, <code>llrint</code>, <code>llrintf</code>—round to integer</a></li> | ||
| 101 | <li><a id="toc-lround_002c-lroundf_002c-llround_002c-llroundf_002d_002d_002dround-to-integer_002c-to-nearest" href="#lround">1.40 <code>lround</code>, <code>lroundf</code>, <code>llround</code>, <code>llroundf</code>—round to integer, to nearest</a></li> | ||
| 102 | <li><a id="toc-modf_002c-modff_002d_002d_002dsplit-fractional-and-integer-parts" href="#modf">1.41 <code>modf</code>, <code>modff</code>—split fractional and integer parts</a></li> | ||
| 103 | <li><a id="toc-nan_002c-nanf_002d_002d_002drepresentation-of-_0060_0060Not-a-Number_0027_0027" href="#nan">1.42 <code>nan</code>, <code>nanf</code>—representation of “Not a Number”</a></li> | ||
| 104 | <li><a id="toc-nearbyint_002c-nearbyintf_002d_002d_002dround-to-integer" href="#nearbyint">1.43 <code>nearbyint</code>, <code>nearbyintf</code>—round to integer</a></li> | ||
| 105 | <li><a id="toc-nextafter_002c-nextafterf_002d_002d_002dget-next-number" href="#nextafter">1.44 <code>nextafter</code>, <code>nextafterf</code>—get next number</a></li> | ||
| 106 | <li><a id="toc-pow_002c-powf_002d_002d_002dx-to-the-power-y" href="#pow">1.45 <code>pow</code>, <code>powf</code>—x to the power y</a></li> | ||
| 107 | <li><a id="toc-pow10_002c-pow10f_002d_002d_002dbase-10-power-functions" href="#pow10">1.46 <code>pow10</code>, <code>pow10f</code>—base 10 power functions</a></li> | ||
| 108 | <li><a id="toc-remainder_002c-remainderf_002d_002d_002dround-and-remainder" href="#remainder">1.47 <code>remainder</code>, <code>remainderf</code>—round and remainder</a></li> | ||
| 109 | <li><a id="toc-remquo_002c-remquof_002d_002d_002dremainder-and-part-of-quotient" href="#remquo">1.48 <code>remquo</code>, <code>remquof</code>—remainder and part of quotient</a></li> | ||
| 110 | <li><a id="toc-rint_002c-rintf_002d_002d_002dround-to-integer" href="#rint">1.49 <code>rint</code>, <code>rintf</code>—round to integer</a></li> | ||
| 111 | <li><a id="toc-round_002c-roundf_002d_002d_002dround-to-integer_002c-to-nearest" href="#round">1.50 <code>round</code>, <code>roundf</code>—round to integer, to nearest</a></li> | ||
| 112 | <li><a id="toc-scalbn_002c-scalbnf_002c-scalbln_002c-scalblnf_002d_002d_002dscale-by-power-of-FLT_005fRADIX-_0028_003d2_0029" href="#scalbn">1.51 <code>scalbn</code>, <code>scalbnf</code>, <code>scalbln</code>, <code>scalblnf</code>—scale by power of FLT_RADIX (=2)</a></li> | ||
| 113 | <li><a id="toc-signbit_002d_002d_002dDoes-floating_002dpoint-number-have-negative-sign_003f" href="#signbit">1.52 <code>signbit</code>—Does floating-point number have negative sign?</a></li> | ||
| 114 | <li><a id="toc-sin_002c-sinf_002c-cos_002c-cosf_002d_002d_002dsine-or-cosine" href="#sin">1.53 <code>sin</code>, <code>sinf</code>, <code>cos</code>, <code>cosf</code>—sine or cosine</a></li> | ||
| 115 | <li><a id="toc-sinh_002c-sinhf_002d_002d_002dhyperbolic-sine" href="#sinh">1.54 <code>sinh</code>, <code>sinhf</code>—hyperbolic sine</a></li> | ||
| 116 | <li><a id="toc-sqrt_002c-sqrtf_002d_002d_002dpositive-square-root" href="#sqrt">1.55 <code>sqrt</code>, <code>sqrtf</code>—positive square root</a></li> | ||
| 117 | <li><a id="toc-tan_002c-tanf_002d_002d_002dtangent" href="#tan">1.56 <code>tan</code>, <code>tanf</code>—tangent</a></li> | ||
| 118 | <li><a id="toc-tanh_002c-tanhf_002d_002d_002dhyperbolic-tangent" href="#tanh">1.57 <code>tanh</code>, <code>tanhf</code>—hyperbolic tangent</a></li> | ||
| 119 | <li><a id="toc-trunc_002c-truncf_002d_002d_002dround-to-integer_002c-towards-zero" href="#trunc">1.58 <code>trunc</code>, <code>truncf</code>—round to integer, towards zero</a></li> | ||
| 120 | </ul></li> | ||
| 121 | <li><a id="toc-Mathematical-Complex-Functions-_0028complex_002eh_0029" href="#Complex">2 Mathematical Complex Functions (<samp>complex.h</samp>)</a> | ||
| 122 | <ul class="no-bullet"> | ||
| 123 | <li><a id="toc-cabs_002c-cabsf_002c-cabsl_002d_002d_002dcomplex-absolute_002dvalue" href="#cabs">2.1 <code>cabs</code>, <code>cabsf</code>, <code>cabsl</code>—complex absolute-value</a></li> | ||
| 124 | <li><a id="toc-cacos_002c-cacosf_002d_002d_002dcomplex-arc-cosine" href="#cacos">2.2 <code>cacos</code>, <code>cacosf</code>—complex arc cosine</a></li> | ||
| 125 | <li><a id="toc-cacosh_002c-cacoshf_002d_002d_002dcomplex-arc-hyperbolic-cosine" href="#cacosh">2.3 <code>cacosh</code>, <code>cacoshf</code>—complex arc hyperbolic cosine</a></li> | ||
| 126 | <li><a id="toc-carg_002c-cargf_002d_002d_002dargument-_0028phase-angle_0029" href="#carg">2.4 <code>carg</code>, <code>cargf</code>—argument (phase angle)</a></li> | ||
| 127 | <li><a id="toc-casin_002c-casinf_002d_002d_002dcomplex-arc-sine" href="#casin">2.5 <code>casin</code>, <code>casinf</code>—complex arc sine</a></li> | ||
| 128 | <li><a id="toc-casinh_002c-casinhf_002d_002d_002dcomplex-arc-hyperbolic-sine" href="#casinh">2.6 <code>casinh</code>, <code>casinhf</code>—complex arc hyperbolic sine</a></li> | ||
| 129 | <li><a id="toc-catan_002c-catanf_002d_002d_002dcomplex-arc-tangent" href="#catan">2.7 <code>catan</code>, <code>catanf</code>—complex arc tangent</a></li> | ||
| 130 | <li><a id="toc-catanh_002c-catanhf_002d_002d_002dcomplex-arc-hyperbolic-tangent" href="#catanh">2.8 <code>catanh</code>, <code>catanhf</code>—complex arc hyperbolic tangent</a></li> | ||
| 131 | <li><a id="toc-ccos_002c-ccosf_002d_002d_002dcomplex-cosine" href="#ccos">2.9 <code>ccos</code>, <code>ccosf</code>—complex cosine</a></li> | ||
| 132 | <li><a id="toc-ccosh_002c-ccoshf_002d_002d_002dcomplex-hyperbolic-cosine" href="#ccosh">2.10 <code>ccosh</code>, <code>ccoshf</code>—complex hyperbolic cosine</a></li> | ||
| 133 | <li><a id="toc-cexp_002c-cexpf_002d_002d_002dcomplex-base_002de-exponential" href="#cexp">2.11 <code>cexp</code>, <code>cexpf</code>—complex base-e exponential</a></li> | ||
| 134 | <li><a id="toc-cimag_002c-cimagf_002c-cimagl_002d_002d_002dimaginary-part" href="#cimag">2.12 <code>cimag</code>, <code>cimagf</code>, <code>cimagl</code>—imaginary part</a></li> | ||
| 135 | <li><a id="toc-clog_002c-clogf_002d_002d_002dcomplex-base_002de-logarithm" href="#clog">2.13 <code>clog</code>, <code>clogf</code>—complex base-e logarithm</a></li> | ||
| 136 | <li><a id="toc-clog10_002c-clog10f_002d_002d_002dcomplex-base_002d10-logarithm" href="#clog10">2.14 <code>clog10</code>, <code>clog10f</code>—complex base-10 logarithm</a></li> | ||
| 137 | <li><a id="toc-conj_002c-conjf_002d_002d_002dcomplex-conjugate" href="#conj">2.15 <code>conj</code>, <code>conjf</code>—complex conjugate</a></li> | ||
| 138 | <li><a id="toc-cpow_002c-cpowf_002d_002d_002dcomplex-power" href="#cpow">2.16 <code>cpow</code>, <code>cpowf</code>—complex power</a></li> | ||
| 139 | <li><a id="toc-cproj_002c-cprojf_002d_002d_002d-Riemann-sphere-projection" href="#cproj">2.17 <code>cproj</code>, <code>cprojf</code>— Riemann sphere projection</a></li> | ||
| 140 | <li><a id="toc-creal_002c-crealf_002c-creall_002d_002d_002dreal-part" href="#creal">2.18 <code>creal</code>, <code>crealf</code>, <code>creall</code>—real part</a></li> | ||
| 141 | <li><a id="toc-csin_002c-csinf_002d_002d_002dcomplex-sine" href="#csin">2.19 <code>csin</code>, <code>csinf</code>—complex sine</a></li> | ||
| 142 | <li><a id="toc-csinh_002c-csinhf_002d_002d_002dcomplex-hyperbolic-sine" href="#csinh">2.20 <code>csinh</code>, <code>csinhf</code>—complex hyperbolic sine</a></li> | ||
| 143 | <li><a id="toc-csqrt_002c-csqrtf_002d_002d_002dcomplex-square-root" href="#csqrt">2.21 <code>csqrt</code>, <code>csqrtf</code>—complex square root</a></li> | ||
| 144 | <li><a id="toc-ctan_002c-ctanf_002d_002d_002dcomplex-tangent" href="#ctan">2.22 <code>ctan</code>, <code>ctanf</code>—complex tangent</a></li> | ||
| 145 | <li><a id="toc-ctanh_002c-ctanf_002d_002d_002dcomplex-hyperbolic-tangent" href="#ctanh">2.23 <code>ctanh</code>, <code>ctanf</code>—complex hyperbolic tangent</a></li> | ||
| 146 | </ul></li> | ||
| 147 | <li><a id="toc-Floating_002dPoint-Environment-_0028fenv_002eh_0029" href="#Fenv">3 Floating-Point Environment (<samp>fenv.h</samp>)</a> | ||
| 148 | <ul class="no-bullet"> | ||
| 149 | <li><a id="toc-feclearexcept_002d_002d_002dclear-floating_002dpoint-exception" href="#feclearexcept">3.1 <code>feclearexcept</code>—clear floating-point exception</a></li> | ||
| 150 | <li><a id="toc-fegetenv_002d_002d_002dget-current-floating_002dpoint-environment" href="#fegetenv">3.2 <code>fegetenv</code>—get current floating-point environment</a></li> | ||
| 151 | <li><a id="toc-fegetexceptflag_002d_002d_002dget-floating_002dpoint-status-flags" href="#fegetexceptflag">3.3 <code>fegetexceptflag</code>—get floating-point status flags</a></li> | ||
| 152 | <li><a id="toc-fegetround_002d_002d_002dget-current-rounding-direction" href="#fegetround">3.4 <code>fegetround</code>—get current rounding direction</a></li> | ||
| 153 | <li><a id="toc-feholdexcept_002d_002d_002dsave-current-floating_002dpoint-environment" href="#feholdexcept">3.5 <code>feholdexcept</code>—save current floating-point environment</a></li> | ||
| 154 | <li><a id="toc-feraiseexcept_002d_002d_002draise-floating_002dpoint-exception" href="#feraiseexcept">3.6 <code>feraiseexcept</code>—raise floating-point exception</a></li> | ||
| 155 | <li><a id="toc-fesetenv_002d_002d_002dset-current-floating_002dpoint-environment" href="#fesetenv">3.7 <code>fesetenv</code>—set current floating-point environment</a></li> | ||
| 156 | <li><a id="toc-fesetexceptflag_002d_002d_002dset-floating_002dpoint-status-flags" href="#fesetexceptflag">3.8 <code>fesetexceptflag</code>—set floating-point status flags</a></li> | ||
| 157 | <li><a id="toc-fesetround_002d_002d_002dset-current-rounding-direction" href="#fesetround">3.9 <code>fesetround</code>—set current rounding direction</a></li> | ||
| 158 | <li><a id="toc-fetestexcept_002d_002d_002dtest-floating_002dpoint-exception-flags" href="#fetestexcept">3.10 <code>fetestexcept</code>—test floating-point exception flags</a></li> | ||
| 159 | <li><a id="toc-feupdateenv_002d_002d_002dupdate-current-floating_002dpoint-environment" href="#feupdateenv">3.11 <code>feupdateenv</code>—update current floating-point environment</a></li> | ||
| 160 | </ul></li> | ||
| 161 | <li><a id="toc-Reentrancy-Properties-of-libm" href="#Reentrancy">4 Reentrancy Properties of <code>libm</code></a></li> | ||
| 162 | <li><a id="toc-The-long-double-function-support-of-libm" href="#Long-Double-Functions">5 The long double function support of <code>libm</code></a></li> | ||
| 163 | <li><a id="toc-Document-Index-1" href="#Document-Index" rel="index">Document Index</a></li> | ||
| 164 | </ul> | ||
| 165 | </div> | ||
| 166 | </div> | ||
| 74 | <hr> | 167 | <hr> |
| 75 | <a name="Math"></a> | 168 | <div class="chapter" id="Math"> |
| 76 | <div class="header"> | 169 | <div class="header"> |
| 77 | <p> | 170 | <p> |
| 78 | Next: <a href="#Complex" accesskey="n" rel="next">Complex</a>, Previous: <a href="#Top" accesskey="p" rel="previous">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 171 | Next: <a href="#Complex" accesskey="n" rel="next">Mathematical Complex Functions (<samp>complex.h</samp>)</a>, Previous: <a href="#Top" accesskey="p" rel="prev">LIBM</a>, Up: <a href="#Top" accesskey="u" rel="up">LIBM</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 79 | </div> | 172 | </div> |
| 80 | <a name="Mathematical-Functions-_0028math_002eh_0029"></a> | 173 | <span id="Mathematical-Functions-_0028math_002eh_0029"></span><h2 class="chapter">1 Mathematical Functions (<samp>math.h</samp>)</h2> |
| 81 | <h2 class="chapter">1 Mathematical Functions (<samp>math.h</samp>)</h2> | ||
| 82 | 174 | ||
| 83 | <p>This chapter groups a wide variety of mathematical functions. The | 175 | <p>This chapter groups a wide variety of mathematical functions. The |
| 84 | corresponding definitions and declarations are in <samp>math.h</samp>. | 176 | corresponding definitions and declarations are in <samp>math.h</samp>. |
| 85 | Two definitions from <samp>math.h</samp> are of particular interest. | 177 | The definition of HUGE_VAL from <samp>math.h</samp> is of particular interest. |
| 86 | </p> | 178 | </p> |
| 87 | <ol> | 179 | <ol> |
| 88 | <li> The representation of infinity as a <code>double</code> is defined as | 180 | <li> The representation of infinity as a <code>double</code> is defined as |
| 89 | <code>HUGE_VAL</code>; this number is returned on overflow by many functions. | 181 | <code>HUGE_VAL</code>; this number is returned on overflow by many functions. |
| 90 | The macro <code>HUGE_VALF</code> is a corresponding value for <code>float</code>. | 182 | The macro <code>HUGE_VALF</code> is a corresponding value for <code>float</code>. |
| 91 | |||
| 92 | </li><li> The structure <code>exception</code> is used when you write customized error | ||
| 93 | handlers for the mathematical functions. You can customize error | ||
| 94 | handling for most of these functions by defining your own version of | ||
| 95 | <code>matherr</code>; see the section on <code>matherr</code> for details. | ||
| 96 | </li></ol> | 183 | </li></ol> |
| 97 | 184 | ||
| 98 | <a name="index-system-calls"></a> | ||
| 99 | <a name="index-support-subroutines"></a> | ||
| 100 | <a name="index-stubs"></a> | ||
| 101 | <a name="index-OS-stubs"></a> | ||
| 102 | <p>Since the error handling code calls <code>fputs</code>, the mathematical | ||
| 103 | subroutines require stubs or minimal implementations for the same list | ||
| 104 | of OS subroutines as <code>fputs</code>: <code>close</code>, <code>fstat</code>, | ||
| 105 | <code>isatty</code>, <code>lseek</code>, <code>read</code>, <code>sbrk</code>, <code>write</code>. | ||
| 106 | See <a href="http://www.gnu.org/software/libc/manual/html_mono/libc.html#syscalls">System Calls</a> in <cite>The Red Hat newlib C Library</cite>, | ||
| 107 | for a discussion and for sample minimal implementations of these support | ||
| 108 | subroutines. | ||
| 109 | </p> | ||
| 110 | <p>Alternative declarations of the mathematical functions, which exploit | 185 | <p>Alternative declarations of the mathematical functions, which exploit |
| 111 | specific machine capabilities to operate faster—but generally have | 186 | specific machine capabilities to operate faster—but generally have |
| 112 | less error checking and may reflect additional limitations on some | 187 | less error checking and may reflect additional limitations on some |
| 113 | machines—are available when you include <samp>fastmath.h</samp> instead of | 188 | machines—are available when you include <samp>fastmath.h</samp> instead of |
| 114 | <samp>math.h</samp>. | 189 | <samp>math.h</samp>. |
| 115 | </p> | 190 | </p> |
| 116 | <table class="menu" border="0" cellspacing="0"> | ||
| 117 | <tr><td align="left" valign="top">• <a href="#version" accesskey="1">version</a>:</td><td> </td><td align="left" valign="top">Version of library | ||
| 118 | </td></tr> | ||
| 119 | <tr><td align="left" valign="top">• <a href="#acos" accesskey="2">acos</a>:</td><td> </td><td align="left" valign="top">Arccosine | ||
| 120 | </td></tr> | ||
| 121 | <tr><td align="left" valign="top">• <a href="#acosh" accesskey="3">acosh</a>:</td><td> </td><td align="left" valign="top">Inverse hyperbolic cosine | ||
| 122 | </td></tr> | ||
| 123 | <tr><td align="left" valign="top">• <a href="#asin" accesskey="4">asin</a>:</td><td> </td><td align="left" valign="top">Arcsine | ||
| 124 | </td></tr> | ||
| 125 | <tr><td align="left" valign="top">• <a href="#asinh" accesskey="5">asinh</a>:</td><td> </td><td align="left" valign="top">Inverse hyperbolic sine | ||
| 126 | </td></tr> | ||
| 127 | <tr><td align="left" valign="top">• <a href="#atan" accesskey="6">atan</a>:</td><td> </td><td align="left" valign="top">Arctangent | ||
| 128 | </td></tr> | ||
| 129 | <tr><td align="left" valign="top">• <a href="#atan2" accesskey="7">atan2</a>:</td><td> </td><td align="left" valign="top">Arctangent of y/x | ||
| 130 | </td></tr> | ||
| 131 | <tr><td align="left" valign="top">• <a href="#atanh" accesskey="8">atanh</a>:</td><td> </td><td align="left" valign="top">Inverse hyperbolic tangent | ||
| 132 | </td></tr> | ||
| 133 | <tr><td align="left" valign="top">• <a href="#jN" accesskey="9">jN</a>:</td><td> </td><td align="left" valign="top">Bessel functions (jN, yN) | ||
| 134 | </td></tr> | ||
| 135 | <tr><td align="left" valign="top">• <a href="#cbrt">cbrt</a>:</td><td> </td><td align="left" valign="top">Cube root | ||
| 136 | </td></tr> | ||
| 137 | <tr><td align="left" valign="top">• <a href="#copysign">copysign</a>:</td><td> </td><td align="left" valign="top">Sign of Y, magnitude of X | ||
| 138 | </td></tr> | ||
| 139 | <tr><td align="left" valign="top">• <a href="#cosh">cosh</a>:</td><td> </td><td align="left" valign="top">Hyperbolic cosine | ||
| 140 | </td></tr> | ||
| 141 | <tr><td align="left" valign="top">• <a href="#erf">erf</a>:</td><td> </td><td align="left" valign="top">Error function (erf, erfc) | ||
| 142 | </td></tr> | ||
| 143 | <tr><td align="left" valign="top">• <a href="#exp">exp</a>:</td><td> </td><td align="left" valign="top">Exponential, base e | ||
| 144 | </td></tr> | ||
| 145 | <tr><td align="left" valign="top">• <a href="#exp2">exp2</a>:</td><td> </td><td align="left" valign="top">Exponential, base 2 | ||
| 146 | </td></tr> | ||
| 147 | <tr><td align="left" valign="top">• <a href="#expm1">expm1</a>:</td><td> </td><td align="left" valign="top">Exponential, base e, of x - 1 | ||
| 148 | </td></tr> | ||
| 149 | <tr><td align="left" valign="top">• <a href="#fabs">fabs</a>:</td><td> </td><td align="left" valign="top">Absolute value (magnitude) | ||
| 150 | </td></tr> | ||
| 151 | <tr><td align="left" valign="top">• <a href="#fdim">fdim</a>:</td><td> </td><td align="left" valign="top">Positive difference | ||
| 152 | </td></tr> | ||
| 153 | <tr><td align="left" valign="top">• <a href="#floor">floor</a>:</td><td> </td><td align="left" valign="top">Floor and ceiling (floor, ceil) | ||
| 154 | </td></tr> | ||
| 155 | <tr><td align="left" valign="top">• <a href="#fma">fma</a>:</td><td> </td><td align="left" valign="top">Floating multiply add | ||
| 156 | </td></tr> | ||
| 157 | <tr><td align="left" valign="top">• <a href="#fmax">fmax</a>:</td><td> </td><td align="left" valign="top">Maximum | ||
| 158 | </td></tr> | ||
| 159 | <tr><td align="left" valign="top">• <a href="#fmin">fmin</a>:</td><td> </td><td align="left" valign="top">Minimum | ||
| 160 | </td></tr> | ||
| 161 | <tr><td align="left" valign="top">• <a href="#fmod">fmod</a>:</td><td> </td><td align="left" valign="top">Floating-point remainder (modulo) | ||
| 162 | </td></tr> | ||
| 163 | <tr><td align="left" valign="top">• <a href="#fpclassify">fpclassify</a>:</td><td> </td><td align="left" valign="top">Floating-point classification macro | ||
| 164 | </td></tr> | ||
| 165 | <tr><td align="left" valign="top">• <a href="#frexp">frexp</a>:</td><td> </td><td align="left" valign="top">Split floating-point number | ||
| 166 | </td></tr> | ||
| 167 | <tr><td align="left" valign="top">• <a href="#gamma">gamma</a>:</td><td> </td><td align="left" valign="top">Logarithmic gamma function | ||
| 168 | </td></tr> | ||
| 169 | <tr><td align="left" valign="top">• <a href="#hypot">hypot</a>:</td><td> </td><td align="left" valign="top">Distance from origin | ||
| 170 | </td></tr> | ||
| 171 | <tr><td align="left" valign="top">• <a href="#ilogb">ilogb</a>:</td><td> </td><td align="left" valign="top">Get exponent | ||
| 172 | </td></tr> | ||
| 173 | <tr><td align="left" valign="top">• <a href="#infinity">infinity</a>:</td><td> </td><td align="left" valign="top">Floating infinity | ||
| 174 | </td></tr> | ||
| 175 | <tr><td align="left" valign="top">• <a href="#isgreater">isgreater</a>:</td><td> </td><td align="left" valign="top">Comparison macros | ||
| 176 | </td></tr> | ||
| 177 | <tr><td align="left" valign="top">• <a href="#ldexp">ldexp</a>:</td><td> </td><td align="left" valign="top">Scale by a power of 2 | ||
| 178 | </td></tr> | ||
| 179 | <tr><td align="left" valign="top">• <a href="#log">log</a>:</td><td> </td><td align="left" valign="top">Natural logarithms | ||
| 180 | </td></tr> | ||
| 181 | <tr><td align="left" valign="top">• <a href="#log10">log10</a>:</td><td> </td><td align="left" valign="top">Base 10 logarithms | ||
| 182 | </td></tr> | ||
| 183 | <tr><td align="left" valign="top">• <a href="#log1p">log1p</a>:</td><td> </td><td align="left" valign="top">Log of 1 + X | ||
| 184 | </td></tr> | ||
| 185 | <tr><td align="left" valign="top">• <a href="#log2">log2</a>:</td><td> </td><td align="left" valign="top">Base 2 logarithms | ||
| 186 | </td></tr> | ||
| 187 | <tr><td align="left" valign="top">• <a href="#logb">logb</a>:</td><td> </td><td align="left" valign="top">Get exponent | ||
| 188 | </td></tr> | ||
| 189 | <tr><td align="left" valign="top">• <a href="#lrint">lrint</a>:</td><td> </td><td align="left" valign="top">Round to integer | ||
| 190 | </td></tr> | ||
| 191 | <tr><td align="left" valign="top">• <a href="#lround">lround</a>:</td><td> </td><td align="left" valign="top">Round to integer, away from zero (lround, llround) | ||
| 192 | </td></tr> | ||
| 193 | <tr><td align="left" valign="top">• <a href="#matherr">matherr</a>:</td><td> </td><td align="left" valign="top">Modifiable math error handler | ||
| 194 | </td></tr> | ||
| 195 | <tr><td align="left" valign="top">• <a href="#modf">modf</a>:</td><td> </td><td align="left" valign="top">Split fractional and integer parts | ||
| 196 | </td></tr> | ||
| 197 | <tr><td align="left" valign="top">• <a href="#nan">nan</a>:</td><td> </td><td align="left" valign="top">Floating Not a Number | ||
| 198 | </td></tr> | ||
| 199 | <tr><td align="left" valign="top">• <a href="#nearbyint">nearbyint</a>:</td><td> </td><td align="left" valign="top">Round to integer | ||
| 200 | </td></tr> | ||
| 201 | <tr><td align="left" valign="top">• <a href="#nextafter">nextafter</a>:</td><td> </td><td align="left" valign="top">Get next representable number | ||
| 202 | </td></tr> | ||
| 203 | <tr><td align="left" valign="top">• <a href="#pow">pow</a>:</td><td> </td><td align="left" valign="top">X to the power Y | ||
| 204 | </td></tr> | ||
| 205 | <tr><td align="left" valign="top">• <a href="#remainder">remainder</a>:</td><td> </td><td align="left" valign="top">remainder of X divided by Y | ||
| 206 | </td></tr> | ||
| 207 | <tr><td align="left" valign="top">• <a href="#remquo">remquo</a>:</td><td> </td><td align="left" valign="top">Remainder and part of quotient | ||
| 208 | </td></tr> | ||
| 209 | <tr><td align="left" valign="top">• <a href="#rint">rint</a>:</td><td> </td><td align="left" valign="top">Round to integer | ||
| 210 | </td></tr> | ||
| 211 | <tr><td align="left" valign="top">• <a href="#round">round</a>:</td><td> </td><td align="left" valign="top">Round to integer, away from zero | ||
| 212 | </td></tr> | ||
| 213 | <tr><td align="left" valign="top">• <a href="#scalbn">scalbn</a>:</td><td> </td><td align="left" valign="top">Scale by a power of FLT_RADIX (2) | ||
| 214 | </td></tr> | ||
| 215 | <tr><td align="left" valign="top">• <a href="#signbit">signbit</a>:</td><td> </td><td align="left" valign="top">Does floating-point number have negative sign? | ||
| 216 | </td></tr> | ||
| 217 | <tr><td align="left" valign="top">• <a href="#sin">sin</a>:</td><td> </td><td align="left" valign="top">Sine or cosine (sin, cos) | ||
| 218 | </td></tr> | ||
| 219 | <tr><td align="left" valign="top">• <a href="#sinh">sinh</a>:</td><td> </td><td align="left" valign="top">Hyperbolic sine | ||
| 220 | </td></tr> | ||
| 221 | <tr><td align="left" valign="top">• <a href="#sqrt">sqrt</a>:</td><td> </td><td align="left" valign="top">Positive square root | ||
| 222 | </td></tr> | ||
| 223 | <tr><td align="left" valign="top">• <a href="#tan">tan</a>:</td><td> </td><td align="left" valign="top">Tangent | ||
| 224 | </td></tr> | ||
| 225 | <tr><td align="left" valign="top">• <a href="#tanh">tanh</a>:</td><td> </td><td align="left" valign="top">Hyperbolic tangent | ||
| 226 | </td></tr> | ||
| 227 | <tr><td align="left" valign="top">• <a href="#trunc">trunc</a>:</td><td> </td><td align="left" valign="top">Round to integer, towards zero | ||
| 228 | </td></tr> | ||
| 229 | </table> | ||
| 230 | 191 | ||
| 192 | <ul class="section-toc"> | ||
| 193 | <li><a href="#version" accesskey="1">Error Handling</a></li> | ||
| 194 | <li><a href="#Standards-Compliance-And-Portability" accesskey="2">Standards Compliance And Portability</a></li> | ||
| 195 | <li><a href="#acos" accesskey="3"><code>acos</code>, <code>acosf</code>—arc cosine</a></li> | ||
| 196 | <li><a href="#acosh" accesskey="4"><code>acosh</code>, <code>acoshf</code>—inverse hyperbolic cosine</a></li> | ||
| 197 | <li><a href="#asin" accesskey="5"><code>asin</code>, <code>asinf</code>—arc sine</a></li> | ||
| 198 | <li><a href="#asinh" accesskey="6"><code>asinh</code>, <code>asinhf</code>—inverse hyperbolic sine</a></li> | ||
| 199 | <li><a href="#atan" accesskey="7"><code>atan</code>, <code>atanf</code>—arc tangent</a></li> | ||
| 200 | <li><a href="#atan2" accesskey="8"><code>atan2</code>, <code>atan2f</code>—arc tangent of y/x</a></li> | ||
| 201 | <li><a href="#atanh" accesskey="9"><code>atanh</code>, <code>atanhf</code>—inverse hyperbolic tangent</a></li> | ||
| 202 | <li><a href="#jN"><code>jN</code>, <code>jNf</code>, <code>yN</code>, <code>yNf</code>—Bessel functions</a></li> | ||
| 203 | <li><a href="#cbrt"><code>cbrt</code>, <code>cbrtf</code>—cube root</a></li> | ||
| 204 | <li><a href="#copysign"><code>copysign</code>, <code>copysignf</code>—sign of <var>y</var>, magnitude of <var>x</var></a></li> | ||
| 205 | <li><a href="#cosh"><code>cosh</code>, <code>coshf</code>—hyperbolic cosine</a></li> | ||
| 206 | <li><a href="#erf"><code>erf</code>, <code>erff</code>, <code>erfc</code>, <code>erfcf</code>—error function</a></li> | ||
| 207 | <li><a href="#exp"><code>exp</code>, <code>expf</code>—exponential</a></li> | ||
| 208 | <li><a href="#exp10"><code>exp10</code>, <code>exp10f</code>—exponential, base 10</a></li> | ||
| 209 | <li><a href="#exp2"><code>exp2</code>, <code>exp2f</code>—exponential, base 2</a></li> | ||
| 210 | <li><a href="#expm1"><code>expm1</code>, <code>expm1f</code>—exponential minus 1</a></li> | ||
| 211 | <li><a href="#fabs"><code>fabs</code>, <code>fabsf</code>—absolute value (magnitude)</a></li> | ||
| 212 | <li><a href="#fdim"><code>fdim</code>, <code>fdimf</code>—positive difference</a></li> | ||
| 213 | <li><a href="#floor"><code>floor</code>, <code>floorf</code>, <code>ceil</code>, <code>ceilf</code>—floor and ceiling</a></li> | ||
| 214 | <li><a href="#fma"><code>fma</code>, <code>fmaf</code>—floating multiply add</a></li> | ||
| 215 | <li><a href="#fmax"><code>fmax</code>, <code>fmaxf</code>—maximum</a></li> | ||
| 216 | <li><a href="#fmin"><code>fmin</code>, <code>fminf</code>—minimum</a></li> | ||
| 217 | <li><a href="#fmod"><code>fmod</code>, <code>fmodf</code>—floating-point remainder (modulo)</a></li> | ||
| 218 | <li><a href="#frexp"><code>frexp</code>, <code>frexpf</code>—split floating-point number</a></li> | ||
| 219 | <li><a href="#gamma"><code>gamma</code>, <code>gammaf</code>, <code>lgamma</code>, <code>lgammaf</code>, <code>gamma_r</code>, <code>gammaf_r</code>, <code>lgamma_r</code>, <code>lgammaf_r</code>, <code>tgamma</code>, and <code>tgammaf</code>—logarithmic and plain gamma functions</a></li> | ||
| 220 | <li><a href="#hypot"><code>hypot</code>, <code>hypotf</code>—distance from origin</a></li> | ||
| 221 | <li><a href="#ilogb"><code>ilogb</code>, <code>ilogbf</code>—get exponent of floating-point number</a></li> | ||
| 222 | <li><a href="#infinity"><code>infinity</code>, <code>infinityf</code>—representation of infinity</a></li> | ||
| 223 | <li><a href="#isgreater"><code>isgreater</code>, <code>isgreaterequal</code>, <code>isless</code>, <code>islessequal</code>, <code>islessgreater</code>, and <code>isunordered</code>—comparison macros</a></li> | ||
| 224 | <li><a href="#fpclassify"><code>fpclassify</code>, <code>isfinite</code>, <code>isinf</code>, <code>isnan</code>, and <code>isnormal</code>—floating-point classification macros; <code>finite</code>, <code>finitef</code>, <code>isinf</code>, <code>isinff</code>, <code>isnan</code>, <code>isnanf</code>—test for exceptional numbers</a></li> | ||
| 225 | <li><a href="#ldexp"><code>ldexp</code>, <code>ldexpf</code>—load exponent</a></li> | ||
| 226 | <li><a href="#log"><code>log</code>, <code>logf</code>—natural logarithms</a></li> | ||
| 227 | <li><a href="#log10"><code>log10</code>, <code>log10f</code>—base 10 logarithms</a></li> | ||
| 228 | <li><a href="#log1p"><code>log1p</code>, <code>log1pf</code>—log of <code>1 + <var>x</var></code></a></li> | ||
| 229 | <li><a href="#log2"><code>log2</code>, <code>log2f</code>—base 2 logarithm</a></li> | ||
| 230 | <li><a href="#logb"><code>logb</code>, <code>logbf</code>—get exponent of floating-point number</a></li> | ||
| 231 | <li><a href="#lrint"><code>lrint</code>, <code>lrintf</code>, <code>llrint</code>, <code>llrintf</code>—round to integer</a></li> | ||
| 232 | <li><a href="#lround"><code>lround</code>, <code>lroundf</code>, <code>llround</code>, <code>llroundf</code>—round to integer, to nearest</a></li> | ||
| 233 | <li><a href="#modf"><code>modf</code>, <code>modff</code>—split fractional and integer parts</a></li> | ||
| 234 | <li><a href="#nan"><code>nan</code>, <code>nanf</code>—representation of “Not a Number”</a></li> | ||
| 235 | <li><a href="#nearbyint"><code>nearbyint</code>, <code>nearbyintf</code>—round to integer</a></li> | ||
| 236 | <li><a href="#nextafter"><code>nextafter</code>, <code>nextafterf</code>—get next number</a></li> | ||
| 237 | <li><a href="#pow"><code>pow</code>, <code>powf</code>—x to the power y</a></li> | ||
| 238 | <li><a href="#pow10"><code>pow10</code>, <code>pow10f</code>—base 10 power functions</a></li> | ||
| 239 | <li><a href="#remainder"><code>remainder</code>, <code>remainderf</code>—round and remainder</a></li> | ||
| 240 | <li><a href="#remquo"><code>remquo</code>, <code>remquof</code>—remainder and part of quotient</a></li> | ||
| 241 | <li><a href="#rint"><code>rint</code>, <code>rintf</code>—round to integer</a></li> | ||
| 242 | <li><a href="#round"><code>round</code>, <code>roundf</code>—round to integer, to nearest</a></li> | ||
| 243 | <li><a href="#scalbn"><code>scalbn</code>, <code>scalbnf</code>, <code>scalbln</code>, <code>scalblnf</code>—scale by power of FLT_RADIX (=2)</a></li> | ||
| 244 | <li><a href="#signbit"><code>signbit</code>—Does floating-point number have negative sign?</a></li> | ||
| 245 | <li><a href="#sin"><code>sin</code>, <code>sinf</code>, <code>cos</code>, <code>cosf</code>—sine or cosine</a></li> | ||
| 246 | <li><a href="#sinh"><code>sinh</code>, <code>sinhf</code>—hyperbolic sine</a></li> | ||
| 247 | <li><a href="#sqrt"><code>sqrt</code>, <code>sqrtf</code>—positive square root</a></li> | ||
| 248 | <li><a href="#tan"><code>tan</code>, <code>tanf</code>—tangent</a></li> | ||
| 249 | <li><a href="#tanh"><code>tanh</code>, <code>tanhf</code>—hyperbolic tangent</a></li> | ||
| 250 | <li><a href="#trunc"><code>trunc</code>, <code>truncf</code>—round to integer, towards zero</a></li> | ||
| 251 | </ul> | ||
| 231 | <hr> | 252 | <hr> |
| 232 | <a name="version"></a> | 253 | <div class="section" id="version"> |
| 233 | <div class="header"> | 254 | <div class="header"> |
| 234 | <p> | 255 | <p> |
| 235 | Next: <a href="#acos" accesskey="n" rel="next">acos</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 256 | Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 236 | </div> | 257 | </div> |
| 237 | <a name="Error-Handling"></a> | 258 | <span id="Error-Handling"></span><h3 class="section">1.1 Error Handling</h3> |
| 238 | <h3 class="section">1.1 Error Handling</h3> | ||
| 239 | 259 | ||
| 240 | <p>There are four different versions of the math library routines: IEEE, | 260 | <p>There are two different versions of the math library routines: IEEE |
| 241 | POSIX, X/Open, or SVID. The version may be selected at runtime by | 261 | and POSIX. The version may be selected at runtime by |
| 242 | setting the global variable <code>_LIB_VERSION</code>, defined in | 262 | setting the global variable <code>_LIB_VERSION</code>, defined in |
| 243 | <samp>math.h</samp>. It may be set to one of the following constants defined | 263 | <samp>math.h</samp>. It may be set to one of the following constants defined |
| 244 | in <samp>math.h</samp>: <code>_IEEE_</code>, <code>_POSIX_</code>, <code>_XOPEN_</code>, or | 264 | in <samp>math.h</samp>: <code>_IEEE_</code> or <code>_POSIX_</code>. |
| 245 | <code>_SVID_</code>. The <code>_LIB_VERSION</code> variable is not specific to any | 265 | The <code>_LIB_VERSION</code> variable is not specific to any |
| 246 | thread, and changing it will affect all threads. | 266 | thread, and changing it will affect all threads. |
| 247 | </p> | 267 | </p> |
| 248 | <p>The versions of the library differ only in how errors are handled. | 268 | <p>The versions of the library differ only in the setting of <code>errno</code>. |
| 249 | </p> | ||
| 250 | <p>In IEEE mode, the <code>matherr</code> function is never called, no warning | ||
| 251 | messages are printed, and <code>errno</code> is never set. | ||
| 252 | </p> | 269 | </p> |
| 253 | <p>In POSIX mode, <code>errno</code> is set correctly, but the <code>matherr</code> | 270 | <p>In IEEE mode, <code>errno</code> is never set. |
| 254 | function is never called and no warning messages are printed. | ||
| 255 | </p> | 271 | </p> |
| 256 | <p>In X/Open mode, <code>errno</code> is set correctly, and <code>matherr</code> is | 272 | <p>In POSIX mode, <code>errno</code> is set correctly. |
| 257 | called, but warning message are not printed. | ||
| 258 | </p> | 273 | </p> |
| 259 | <p>In SVID mode, functions which overflow return 3.40282346638528860e+38, | 274 | <p>The library is set to IEEE mode by default. |
| 260 | the maximum single-precision floating-point value, rather than infinity. | ||
| 261 | Also, <code>errno</code> is set correctly, <code>matherr</code> is called, and, if | ||
| 262 | <code>matherr</code> returns 0, warning messages are printed for some errors. | ||
| 263 | For example, by default ‘<samp>log(-1.0)</samp>’ writes this message on standard | ||
| 264 | error output: | ||
| 265 | </p> | ||
| 266 | <div class="example"> | ||
| 267 | <pre class="example">log: DOMAIN error | ||
| 268 | </pre></div> | ||
| 269 | |||
| 270 | <p>The library is set to X/Open mode by default. | ||
| 271 | </p> | 275 | </p> |
| 272 | <p>The aforementioned error reporting is the supported Newlib libm error | 276 | <p>The majority of the floating-point math functions are written |
| 273 | handling method. However, the majority of the functions are written | ||
| 274 | so as to produce the floating-point exceptions (e.g. "invalid", | 277 | so as to produce the floating-point exceptions (e.g. "invalid", |
| 275 | "divide-by-zero") as required by the C and POSIX standards, for | 278 | "divide-by-zero") as required by the C and POSIX standards, for |
| 276 | floating-point implementations that support them. Newlib does not provide | 279 | floating-point implementations that support them. Newlib does not provide |
| @@ -279,7 +282,8 @@ for fenv.h, though, which is why they are considered unsupported. It is | |||
| 279 | mentioned in case you have separately-provided access routines so that | 282 | mentioned in case you have separately-provided access routines so that |
| 280 | you are aware that they can be caused. | 283 | you are aware that they can be caused. |
| 281 | </p> | 284 | </p> |
| 282 | <a name="Standards-Compliance-And-Portability"></a> | 285 | </div> |
| 286 | <div class="section" id="Standards-Compliance-And-Portability"> | ||
| 283 | <h3 class="section">1.2 Standards Compliance And Portability</h3> | 287 | <h3 class="section">1.2 Standards Compliance And Portability</h3> |
| 284 | <p>Most of the individual function descriptions describe the standards to which | 288 | <p>Most of the individual function descriptions describe the standards to which |
| 285 | each function complies. However, these descriptions are mostly out of date, | 289 | each function complies. However, these descriptions are mostly out of date, |
| @@ -293,15 +297,15 @@ registered trademark of The IEEE. | |||
| 293 | </p> | 297 | </p> |
| 294 | 298 | ||
| 295 | <hr> | 299 | <hr> |
| 296 | <a name="acos"></a> | 300 | </div> |
| 301 | <div class="section" id="acos"> | ||
| 297 | <div class="header"> | 302 | <div class="header"> |
| 298 | <p> | 303 | <p> |
| 299 | Next: <a href="#acosh" accesskey="n" rel="next">acosh</a>, Previous: <a href="#version" accesskey="p" rel="previous">version</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 304 | Next: <a href="#acosh" accesskey="n" rel="next"><code>acosh</code>, <code>acoshf</code>—inverse hyperbolic cosine</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 300 | </div> | 305 | </div> |
| 301 | <a name="acos_002c-acosf_002d_002d_002darc-cosine"></a> | 306 | <span id="acos_002c-acosf_002d_002d_002darc-cosine"></span><h3 class="section">1.3 <code>acos</code>, <code>acosf</code>—arc cosine</h3> |
| 302 | <h3 class="section">1.3 <code>acos</code>, <code>acosf</code>—arc cosine</h3> | 307 | <span id="index-acos"></span> |
| 303 | <a name="index-acos"></a> | 308 | <span id="index-acosf"></span> |
| 304 | <a name="index-acosf"></a> | ||
| 305 | <p><strong>Synopsis</strong> | 309 | <p><strong>Synopsis</strong> |
| 306 | </p><div class="example"> | 310 | </p><div class="example"> |
| 307 | <pre class="example">#include <math.h> | 311 | <pre class="example">#include <math.h> |
| @@ -322,22 +326,19 @@ its calculations on <code>floats</code>. | |||
| 322 | <code>acos</code> and <code>acosf</code> return values in radians, in the range of 0 to pi. | 326 | <code>acos</code> and <code>acosf</code> return values in radians, in the range of 0 to pi. |
| 323 | </p> | 327 | </p> |
| 324 | <p>If <var>x</var> is not between -1 and 1, the returned value is NaN | 328 | <p>If <var>x</var> is not between -1 and 1, the returned value is NaN |
| 325 | (not a number) the global variable <code>errno</code> is set to <code>EDOM</code>, and a | 329 | (not a number), and the global variable <code>errno</code> is set to <code>EDOM</code>. |
| 326 | <code>DOMAIN error</code> message is sent as standard error output. | ||
| 327 | </p> | ||
| 328 | <p>You can modify error handling for these functions using <code>matherr</code>. | ||
| 329 | </p> | 330 | </p> |
| 330 | <br> | 331 | <br> |
| 331 | <hr> | 332 | <hr> |
| 332 | <a name="acosh"></a> | 333 | </div> |
| 334 | <div class="section" id="acosh"> | ||
| 333 | <div class="header"> | 335 | <div class="header"> |
| 334 | <p> | 336 | <p> |
| 335 | Next: <a href="#asin" accesskey="n" rel="next">asin</a>, Previous: <a href="#acos" accesskey="p" rel="previous">acos</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 337 | Next: <a href="#asin" accesskey="n" rel="next"><code>asin</code>, <code>asinf</code>—arc sine</a>, Previous: <a href="#acos" accesskey="p" rel="prev"><code>acos</code>, <code>acosf</code>—arc cosine</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 336 | </div> | 338 | </div> |
| 337 | <a name="acosh_002c-acoshf_002d_002d_002dinverse-hyperbolic-cosine"></a> | 339 | <span id="acosh_002c-acoshf_002d_002d_002dinverse-hyperbolic-cosine"></span><h3 class="section">1.4 <code>acosh</code>, <code>acoshf</code>—inverse hyperbolic cosine</h3> |
| 338 | <h3 class="section">1.4 <code>acosh</code>, <code>acoshf</code>—inverse hyperbolic cosine</h3> | 340 | <span id="index-acosh"></span> |
| 339 | <a name="index-acosh"></a> | 341 | <span id="index-acoshf"></span> |
| 340 | <a name="index-acoshf"></a> | ||
| 341 | <p><strong>Synopsis</strong> | 342 | <p><strong>Synopsis</strong> |
| 342 | </p><div class="example"> | 343 | </p><div class="example"> |
| 343 | <pre class="example">#include <math.h> | 344 | <pre class="example">#include <math.h> |
| @@ -348,8 +349,8 @@ float acoshf(float <var>x</var>); | |||
| 348 | <p><strong>Description</strong><br> | 349 | <p><strong>Description</strong><br> |
| 349 | <code>acosh</code> calculates the inverse hyperbolic cosine of <var>x</var>. | 350 | <code>acosh</code> calculates the inverse hyperbolic cosine of <var>x</var>. |
| 350 | <code>acosh</code> is defined as | 351 | <code>acosh</code> is defined as |
| 351 | </p><div class="smallexample"> | 352 | </p><div class="example"> |
| 352 | <pre class="smallexample"> log(<var>x</var> + sqrt(<var>x</var>*<var>x</var>-1)) | 353 | <pre class="example"> log(<var>x</var> + sqrt(<var>x</var>*<var>x</var>-1)) |
| 353 | </pre></div> | 354 | </pre></div> |
| 354 | 355 | ||
| 355 | <p><var>x</var> must be a number greater than or equal to 1. | 356 | <p><var>x</var> must be a number greater than or equal to 1. |
| @@ -361,9 +362,6 @@ float acoshf(float <var>x</var>); | |||
| 361 | <code>acosh</code> and <code>acoshf</code> return the calculated value. If <var>x</var> | 362 | <code>acosh</code> and <code>acoshf</code> return the calculated value. If <var>x</var> |
| 362 | less than 1, the return value is NaN and <code>errno</code> is set to <code>EDOM</code>. | 363 | less than 1, the return value is NaN and <code>errno</code> is set to <code>EDOM</code>. |
| 363 | </p> | 364 | </p> |
| 364 | <p>You can change the error-handling behavior with the non-ANSI | ||
| 365 | <code>matherr</code> function. | ||
| 366 | </p> | ||
| 367 | <br> | 365 | <br> |
| 368 | <p><strong>Portability</strong><br> | 366 | <p><strong>Portability</strong><br> |
| 369 | Neither <code>acosh</code> nor <code>acoshf</code> are ANSI C. They are not recommended | 367 | Neither <code>acosh</code> nor <code>acoshf</code> are ANSI C. They are not recommended |
| @@ -371,15 +369,15 @@ for portable programs. | |||
| 371 | </p> | 369 | </p> |
| 372 | <br> | 370 | <br> |
| 373 | <hr> | 371 | <hr> |
| 374 | <a name="asin"></a> | 372 | </div> |
| 373 | <div class="section" id="asin"> | ||
| 375 | <div class="header"> | 374 | <div class="header"> |
| 376 | <p> | 375 | <p> |
| 377 | Next: <a href="#asinh" accesskey="n" rel="next">asinh</a>, Previous: <a href="#acosh" accesskey="p" rel="previous">acosh</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 376 | Next: <a href="#asinh" accesskey="n" rel="next"><code>asinh</code>, <code>asinhf</code>—inverse hyperbolic sine</a>, Previous: <a href="#acosh" accesskey="p" rel="prev"><code>acosh</code>, <code>acoshf</code>—inverse hyperbolic cosine</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 378 | </div> | 377 | </div> |
| 379 | <a name="asin_002c-asinf_002d_002d_002darc-sine"></a> | 378 | <span id="asin_002c-asinf_002d_002d_002darc-sine"></span><h3 class="section">1.5 <code>asin</code>, <code>asinf</code>—arc sine</h3> |
| 380 | <h3 class="section">1.5 <code>asin</code>, <code>asinf</code>—arc sine</h3> | 379 | <span id="index-asin"></span> |
| 381 | <a name="index-asin"></a> | 380 | <span id="index-asinf"></span> |
| 382 | <a name="index-asinf"></a> | ||
| 383 | <p><strong>Synopsis</strong> | 381 | <p><strong>Synopsis</strong> |
| 384 | </p><div class="example"> | 382 | </p><div class="example"> |
| 385 | <pre class="example">#include <math.h> | 383 | <pre class="example">#include <math.h> |
| @@ -395,29 +393,25 @@ Arguments to <code>asin</code> must be in the range -1 to 1. | |||
| 395 | <p><code>asinf</code> is identical to <code>asin</code>, other than taking and | 393 | <p><code>asinf</code> is identical to <code>asin</code>, other than taking and |
| 396 | returning floats. | 394 | returning floats. |
| 397 | </p> | 395 | </p> |
| 398 | <p>You can modify error handling for these routines using <code>matherr</code>. | ||
| 399 | </p> | ||
| 400 | <br> | 396 | <br> |
| 401 | <p><strong>Returns</strong><br> | 397 | <p><strong>Returns</strong><br> |
| 402 | <code>asin</code> returns values in radians, in the range of -pi/2 to pi/2. | 398 | <code>asin</code> returns values in radians, in the range of -pi/2 to pi/2. |
| 403 | </p> | 399 | </p> |
| 404 | <p>If <var>x</var> is not in the range -1 to 1, <code>asin</code> and <code>asinf</code> | 400 | <p>If <var>x</var> is not in the range -1 to 1, <code>asin</code> and <code>asinf</code> |
| 405 | return NaN (not a number), set the global variable <code>errno</code> to | 401 | return NaN (not a number), and the global variable <code>errno</code> is set to |
| 406 | <code>EDOM</code>, and issue a <code>DOMAIN error</code> message. | 402 | <code>EDOM</code>. |
| 407 | </p> | ||
| 408 | <p>You can change this error treatment using <code>matherr</code>. | ||
| 409 | </p> | 403 | </p> |
| 410 | <br> | 404 | <br> |
| 411 | <hr> | 405 | <hr> |
| 412 | <a name="asinh"></a> | 406 | </div> |
| 407 | <div class="section" id="asinh"> | ||
| 413 | <div class="header"> | 408 | <div class="header"> |
| 414 | <p> | 409 | <p> |
| 415 | Next: <a href="#atan" accesskey="n" rel="next">atan</a>, Previous: <a href="#asin" accesskey="p" rel="previous">asin</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 410 | Next: <a href="#atan" accesskey="n" rel="next"><code>atan</code>, <code>atanf</code>—arc tangent</a>, Previous: <a href="#asin" accesskey="p" rel="prev"><code>asin</code>, <code>asinf</code>—arc sine</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 416 | </div> | 411 | </div> |
| 417 | <a name="asinh_002c-asinhf_002d_002d_002dinverse-hyperbolic-sine"></a> | 412 | <span id="asinh_002c-asinhf_002d_002d_002dinverse-hyperbolic-sine"></span><h3 class="section">1.6 <code>asinh</code>, <code>asinhf</code>—inverse hyperbolic sine</h3> |
| 418 | <h3 class="section">1.6 <code>asinh</code>, <code>asinhf</code>—inverse hyperbolic sine</h3> | 413 | <span id="index-asinh"></span> |
| 419 | <a name="index-asinh"></a> | 414 | <span id="index-asinhf"></span> |
| 420 | <a name="index-asinhf"></a> | ||
| 421 | <p><strong>Synopsis</strong> | 415 | <p><strong>Synopsis</strong> |
| 422 | </p><div class="example"> | 416 | </p><div class="example"> |
| 423 | <pre class="example">#include <math.h> | 417 | <pre class="example">#include <math.h> |
| @@ -428,8 +422,8 @@ float asinhf(float <var>x</var>); | |||
| 428 | <p><strong>Description</strong><br> | 422 | <p><strong>Description</strong><br> |
| 429 | <code>asinh</code> calculates the inverse hyperbolic sine of <var>x</var>. | 423 | <code>asinh</code> calculates the inverse hyperbolic sine of <var>x</var>. |
| 430 | <code>asinh</code> is defined as | 424 | <code>asinh</code> is defined as |
| 431 | </p><div class="smallexample"> | 425 | </p><div class="example"> |
| 432 | <pre class="smallexample"> sgn(<var>x</var>) * log(abs(<var>x</var>) + sqrt(1+<var>x</var>*<var>x</var>)) | 426 | <pre class="example"> sgn(<var>x</var>) * log(abs(<var>x</var>) + sqrt(1+<var>x</var>*<var>x</var>)) |
| 433 | </pre></div> | 427 | </pre></div> |
| 434 | 428 | ||
| 435 | <p><code>asinhf</code> is identical, other than taking and returning floats. | 429 | <p><code>asinhf</code> is identical, other than taking and returning floats. |
| @@ -445,15 +439,15 @@ Neither <code>asinh</code> nor <code>asinhf</code> are ANSI C. | |||
| 445 | 439 | ||
| 446 | <br> | 440 | <br> |
| 447 | <hr> | 441 | <hr> |
| 448 | <a name="atan"></a> | 442 | </div> |
| 443 | <div class="section" id="atan"> | ||
| 449 | <div class="header"> | 444 | <div class="header"> |
| 450 | <p> | 445 | <p> |
| 451 | Next: <a href="#atan2" accesskey="n" rel="next">atan2</a>, Previous: <a href="#asinh" accesskey="p" rel="previous">asinh</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 446 | Next: <a href="#atan2" accesskey="n" rel="next"><code>atan2</code>, <code>atan2f</code>—arc tangent of y/x</a>, Previous: <a href="#asinh" accesskey="p" rel="prev"><code>asinh</code>, <code>asinhf</code>—inverse hyperbolic sine</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 452 | </div> | 447 | </div> |
| 453 | <a name="atan_002c-atanf_002d_002d_002darc-tangent"></a> | 448 | <span id="atan_002c-atanf_002d_002d_002darc-tangent"></span><h3 class="section">1.7 <code>atan</code>, <code>atanf</code>—arc tangent</h3> |
| 454 | <h3 class="section">1.7 <code>atan</code>, <code>atanf</code>—arc tangent</h3> | 449 | <span id="index-atan"></span> |
| 455 | <a name="index-atan"></a> | 450 | <span id="index-atanf"></span> |
| 456 | <a name="index-atanf"></a> | ||
| 457 | <p><strong>Synopsis</strong> | 451 | <p><strong>Synopsis</strong> |
| 458 | </p><div class="example"> | 452 | </p><div class="example"> |
| 459 | <pre class="example">#include <math.h> | 453 | <pre class="example">#include <math.h> |
| @@ -478,15 +472,15 @@ float atanf(float <var>x</var>); | |||
| 478 | 472 | ||
| 479 | <br> | 473 | <br> |
| 480 | <hr> | 474 | <hr> |
| 481 | <a name="atan2"></a> | 475 | </div> |
| 476 | <div class="section" id="atan2"> | ||
| 482 | <div class="header"> | 477 | <div class="header"> |
| 483 | <p> | 478 | <p> |
| 484 | Next: <a href="#atanh" accesskey="n" rel="next">atanh</a>, Previous: <a href="#atan" accesskey="p" rel="previous">atan</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 479 | Next: <a href="#atanh" accesskey="n" rel="next"><code>atanh</code>, <code>atanhf</code>—inverse hyperbolic tangent</a>, Previous: <a href="#atan" accesskey="p" rel="prev"><code>atan</code>, <code>atanf</code>—arc tangent</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 485 | </div> | 480 | </div> |
| 486 | <a name="atan2_002c-atan2f_002d_002d_002darc-tangent-of-y_002fx"></a> | 481 | <span id="atan2_002c-atan2f_002d_002d_002darc-tangent-of-y_002fx"></span><h3 class="section">1.8 <code>atan2</code>, <code>atan2f</code>—arc tangent of y/x</h3> |
| 487 | <h3 class="section">1.8 <code>atan2</code>, <code>atan2f</code>—arc tangent of y/x</h3> | 482 | <span id="index-atan2"></span> |
| 488 | <a name="index-atan2"></a> | 483 | <span id="index-atan2f"></span> |
| 489 | <a name="index-atan2f"></a> | ||
| 490 | <p><strong>Synopsis</strong> | 484 | <p><strong>Synopsis</strong> |
| 491 | </p><div class="example"> | 485 | </p><div class="example"> |
| 492 | <pre class="example">#include <math.h> | 486 | <pre class="example">#include <math.h> |
| @@ -509,8 +503,6 @@ pi/2 or -pi/2 | |||
| 509 | <code>atan2</code> and <code>atan2f</code> return a value in radians, in the range of | 503 | <code>atan2</code> and <code>atan2f</code> return a value in radians, in the range of |
| 510 | -pi to pi. | 504 | -pi to pi. |
| 511 | </p> | 505 | </p> |
| 512 | <p>You can modify error handling for these functions using <code>matherr</code>. | ||
| 513 | </p> | ||
| 514 | <br> | 506 | <br> |
| 515 | <p><strong>Portability</strong><br> | 507 | <p><strong>Portability</strong><br> |
| 516 | <code>atan2</code> is ANSI C. <code>atan2f</code> is an extension. | 508 | <code>atan2</code> is ANSI C. <code>atan2f</code> is an extension. |
| @@ -518,15 +510,15 @@ pi/2 or -pi/2 | |||
| 518 | 510 | ||
| 519 | <br> | 511 | <br> |
| 520 | <hr> | 512 | <hr> |
| 521 | <a name="atanh"></a> | 513 | </div> |
| 514 | <div class="section" id="atanh"> | ||
| 522 | <div class="header"> | 515 | <div class="header"> |
| 523 | <p> | 516 | <p> |
| 524 | Next: <a href="#jN" accesskey="n" rel="next">jN</a>, Previous: <a href="#atan2" accesskey="p" rel="previous">atan2</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 517 | Next: <a href="#jN" accesskey="n" rel="next"><code>jN</code>, <code>jNf</code>, <code>yN</code>, <code>yNf</code>—Bessel functions</a>, Previous: <a href="#atan2" accesskey="p" rel="prev"><code>atan2</code>, <code>atan2f</code>—arc tangent of y/x</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 525 | </div> | 518 | </div> |
| 526 | <a name="atanh_002c-atanhf_002d_002d_002dinverse-hyperbolic-tangent"></a> | 519 | <span id="atanh_002c-atanhf_002d_002d_002dinverse-hyperbolic-tangent"></span><h3 class="section">1.9 <code>atanh</code>, <code>atanhf</code>—inverse hyperbolic tangent</h3> |
| 527 | <h3 class="section">1.9 <code>atanh</code>, <code>atanhf</code>—inverse hyperbolic tangent</h3> | 520 | <span id="index-atanh"></span> |
| 528 | <a name="index-atanh"></a> | 521 | <span id="index-atanhf"></span> |
| 529 | <a name="index-atanhf"></a> | ||
| 530 | <p><strong>Synopsis</strong> | 522 | <p><strong>Synopsis</strong> |
| 531 | </p><div class="example"> | 523 | </p><div class="example"> |
| 532 | <pre class="example">#include <math.h> | 524 | <pre class="example">#include <math.h> |
| @@ -545,47 +537,44 @@ float atanhf(float <var>x</var>); | |||
| 545 | <code>atanh</code> and <code>atanhf</code> return the calculated value. | 537 | <code>atanh</code> and <code>atanhf</code> return the calculated value. |
| 546 | </p> | 538 | </p> |
| 547 | <p>If | 539 | <p>If |
| 548 | </p><div class="smallexample"> | 540 | </p><div class="example"> |
| 549 | <pre class="smallexample"><var>x</var>| | 541 | <pre class="example"><var>x</var>| |
| 550 | </pre></div> | 542 | </pre></div> |
| 551 | <p>is greater than 1, the global <code>errno</code> is set to <code>EDOM</code> and | 543 | <p>is greater than 1, the global <code>errno</code> is set to <code>EDOM</code> and |
| 552 | the result is a NaN. A <code>DOMAIN error</code> is reported. | 544 | the result is a NaN. A <code>DOMAIN error</code> is reported. |
| 553 | </p> | 545 | </p> |
| 554 | <p>If | 546 | <p>If |
| 555 | </p><div class="smallexample"> | 547 | </p><div class="example"> |
| 556 | <pre class="smallexample"><var>x</var>| | 548 | <pre class="example"><var>x</var>| |
| 557 | </pre></div> | 549 | </pre></div> |
| 558 | <p>is 1, the global <code>errno</code> is set to <code>EDOM</code>; and the result is | 550 | <p>is 1, the global <code>errno</code> is set to <code>EDOM</code>; and the result is |
| 559 | infinity with the same sign as <code>x</code>. A <code>SING error</code> is reported. | 551 | infinity with the same sign as <code>x</code>. A <code>SING error</code> is reported. |
| 560 | </p> | 552 | </p> |
| 561 | <p>You can modify the error handling for these routines using | ||
| 562 | <code>matherr</code>. | ||
| 563 | </p> | ||
| 564 | <br> | 553 | <br> |
| 565 | <p><strong>Portability</strong><br> | 554 | <p><strong>Portability</strong><br> |
| 566 | Neither <code>atanh</code> nor <code>atanhf</code> are ANSI C. | 555 | Neither <code>atanh</code> nor <code>atanhf</code> are ANSI C. |
| 567 | </p> | 556 | </p> |
| 568 | <br> | 557 | <br> |
| 569 | <hr> | 558 | <hr> |
| 570 | <a name="jN"></a> | 559 | </div> |
| 560 | <div class="section" id="jN"> | ||
| 571 | <div class="header"> | 561 | <div class="header"> |
| 572 | <p> | 562 | <p> |
| 573 | Next: <a href="#cbrt" accesskey="n" rel="next">cbrt</a>, Previous: <a href="#atanh" accesskey="p" rel="previous">atanh</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 563 | Next: <a href="#cbrt" accesskey="n" rel="next"><code>cbrt</code>, <code>cbrtf</code>—cube root</a>, Previous: <a href="#atanh" accesskey="p" rel="prev"><code>atanh</code>, <code>atanhf</code>—inverse hyperbolic tangent</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 574 | </div> | 564 | </div> |
| 575 | <a name="jN_002c-jNf_002c-yN_002c-yNf_002d_002d_002dBessel-functions"></a> | 565 | <span id="jN_002c-jNf_002c-yN_002c-yNf_002d_002d_002dBessel-functions"></span><h3 class="section">1.10 <code>jN</code>, <code>jNf</code>, <code>yN</code>, <code>yNf</code>—Bessel functions</h3> |
| 576 | <h3 class="section">1.10 <code>jN</code>, <code>jNf</code>, <code>yN</code>, <code>yNf</code>—Bessel functions</h3> | 566 | <span id="index-j0"></span> |
| 577 | <a name="index-j0"></a> | 567 | <span id="index-j0f"></span> |
| 578 | <a name="index-j0f"></a> | 568 | <span id="index-j1"></span> |
| 579 | <a name="index-j1"></a> | 569 | <span id="index-j1f"></span> |
| 580 | <a name="index-j1f"></a> | 570 | <span id="index-jn"></span> |
| 581 | <a name="index-jn"></a> | 571 | <span id="index-jnf"></span> |
| 582 | <a name="index-jnf"></a> | 572 | <span id="index-y0"></span> |
| 583 | <a name="index-y0"></a> | 573 | <span id="index-y0f"></span> |
| 584 | <a name="index-y0f"></a> | 574 | <span id="index-y1"></span> |
| 585 | <a name="index-y1"></a> | 575 | <span id="index-y1f"></span> |
| 586 | <a name="index-y1f"></a> | 576 | <span id="index-yn"></span> |
| 587 | <a name="index-yn"></a> | 577 | <span id="index-ynf"></span> |
| 588 | <a name="index-ynf"></a> | ||
| 589 | <p><strong>Synopsis</strong> | 578 | <p><strong>Synopsis</strong> |
| 590 | </p><div class="example"> | 579 | </p><div class="example"> |
| 591 | <pre class="example">#include <math.h> | 580 | <pre class="example">#include <math.h> |
| @@ -606,8 +595,8 @@ float ynf(int <var>n</var>, float <var>x</var>); | |||
| 606 | <p><strong>Description</strong><br> | 595 | <p><strong>Description</strong><br> |
| 607 | The Bessel functions are a family of functions that solve the | 596 | The Bessel functions are a family of functions that solve the |
| 608 | differential equation | 597 | differential equation |
| 609 | </p><div class="smallexample"> | 598 | </p><div class="example"> |
| 610 | <pre class="smallexample"> 2 2 2 | 599 | <pre class="example"> 2 2 2 |
| 611 | x y'' + xy' + (x - p )y = 0 | 600 | x y'' + xy' + (x - p )y = 0 |
| 612 | </pre></div> | 601 | </pre></div> |
| 613 | <p>These functions have many applications in engineering and physics. | 602 | <p>These functions have many applications in engineering and physics. |
| @@ -633,15 +622,15 @@ None of the Bessel functions are in ANSI C. | |||
| 633 | </p> | 622 | </p> |
| 634 | <br> | 623 | <br> |
| 635 | <hr> | 624 | <hr> |
| 636 | <a name="cbrt"></a> | 625 | </div> |
| 626 | <div class="section" id="cbrt"> | ||
| 637 | <div class="header"> | 627 | <div class="header"> |
| 638 | <p> | 628 | <p> |
| 639 | Next: <a href="#copysign" accesskey="n" rel="next">copysign</a>, Previous: <a href="#jN" accesskey="p" rel="previous">jN</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 629 | Next: <a href="#copysign" accesskey="n" rel="next"><code>copysign</code>, <code>copysignf</code>—sign of <var>y</var>, magnitude of <var>x</var></a>, Previous: <a href="#jN" accesskey="p" rel="prev"><code>jN</code>, <code>jNf</code>, <code>yN</code>, <code>yNf</code>—Bessel functions</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 640 | </div> | 630 | </div> |
| 641 | <a name="cbrt_002c-cbrtf_002d_002d_002dcube-root"></a> | 631 | <span id="cbrt_002c-cbrtf_002d_002d_002dcube-root"></span><h3 class="section">1.11 <code>cbrt</code>, <code>cbrtf</code>—cube root</h3> |
| 642 | <h3 class="section">1.11 <code>cbrt</code>, <code>cbrtf</code>—cube root</h3> | 632 | <span id="index-cbrt"></span> |
| 643 | <a name="index-cbrt"></a> | 633 | <span id="index-cbrtf"></span> |
| 644 | <a name="index-cbrtf"></a> | ||
| 645 | <p><strong>Synopsis</strong> | 634 | <p><strong>Synopsis</strong> |
| 646 | </p><div class="example"> | 635 | </p><div class="example"> |
| 647 | <pre class="example">#include <math.h> | 636 | <pre class="example">#include <math.h> |
| @@ -662,15 +651,15 @@ The cube root is returned. | |||
| 662 | </p> | 651 | </p> |
| 663 | <br> | 652 | <br> |
| 664 | <hr> | 653 | <hr> |
| 665 | <a name="copysign"></a> | 654 | </div> |
| 655 | <div class="section" id="copysign"> | ||
| 666 | <div class="header"> | 656 | <div class="header"> |
| 667 | <p> | 657 | <p> |
| 668 | Next: <a href="#cosh" accesskey="n" rel="next">cosh</a>, Previous: <a href="#cbrt" accesskey="p" rel="previous">cbrt</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 658 | Next: <a href="#cosh" accesskey="n" rel="next"><code>cosh</code>, <code>coshf</code>—hyperbolic cosine</a>, Previous: <a href="#cbrt" accesskey="p" rel="prev"><code>cbrt</code>, <code>cbrtf</code>—cube root</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 669 | </div> | 659 | </div> |
| 670 | <a name="copysign_002c-copysignf_002d_002d_002dsign-of-y_002c-magnitude-of-x"></a> | 660 | <span id="copysign_002c-copysignf_002d_002d_002dsign-of-y_002c-magnitude-of-x"></span><h3 class="section">1.12 <code>copysign</code>, <code>copysignf</code>—sign of <var>y</var>, magnitude of <var>x</var></h3> |
| 671 | <h3 class="section">1.12 <code>copysign</code>, <code>copysignf</code>—sign of <var>y</var>, magnitude of <var>x</var></h3> | 661 | <span id="index-copysign"></span> |
| 672 | <a name="index-copysign"></a> | 662 | <span id="index-copysignf"></span> |
| 673 | <a name="index-copysignf"></a> | ||
| 674 | <p><strong>Synopsis</strong> | 663 | <p><strong>Synopsis</strong> |
| 675 | </p><div class="example"> | 664 | </p><div class="example"> |
| 676 | <pre class="example">#include <math.h> | 665 | <pre class="example">#include <math.h> |
| @@ -701,26 +690,26 @@ Definition (Issue 2). | |||
| 701 | 690 | ||
| 702 | <br> | 691 | <br> |
| 703 | <hr> | 692 | <hr> |
| 704 | <a name="cosh"></a> | 693 | </div> |
| 694 | <div class="section" id="cosh"> | ||
| 705 | <div class="header"> | 695 | <div class="header"> |
| 706 | <p> | 696 | <p> |
| 707 | Next: <a href="#erf" accesskey="n" rel="next">erf</a>, Previous: <a href="#copysign" accesskey="p" rel="previous">copysign</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 697 | Next: <a href="#erf" accesskey="n" rel="next"><code>erf</code>, <code>erff</code>, <code>erfc</code>, <code>erfcf</code>—error function</a>, Previous: <a href="#copysign" accesskey="p" rel="prev"><code>copysign</code>, <code>copysignf</code>—sign of <var>y</var>, magnitude of <var>x</var></a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 708 | </div> | 698 | </div> |
| 709 | <a name="cosh_002c-coshf_002d_002d_002dhyperbolic-cosine"></a> | 699 | <span id="cosh_002c-coshf_002d_002d_002dhyperbolic-cosine"></span><h3 class="section">1.13 <code>cosh</code>, <code>coshf</code>—hyperbolic cosine</h3> |
| 710 | <h3 class="section">1.13 <code>cosh</code>, <code>coshf</code>—hyperbolic cosine</h3> | ||
| 711 | <p><strong>Synopsis</strong> | 700 | <p><strong>Synopsis</strong> |
| 712 | </p><div class="example"> | 701 | </p><div class="example"> |
| 713 | <pre class="example">#include <math.h> | 702 | <pre class="example">#include <math.h> |
| 714 | double cosh(double <var>x</var>); | 703 | double cosh(double <var>x</var>); |
| 715 | float coshf(float <var>x</var>) | 704 | float coshf(float <var>x</var>); |
| 716 | 705 | ||
| 717 | </pre></div> | 706 | </pre></div> |
| 718 | <p><strong>Description</strong><br> | 707 | <p><strong>Description</strong><br> |
| 719 | </p> | 708 | </p> |
| 720 | <p><code>cosh</code> computes the hyperbolic cosine of the argument <var>x</var>. | 709 | <p><code>cosh</code> computes the hyperbolic cosine of the argument <var>x</var>. |
| 721 | <code>cosh(<var>x</var>)</code> is defined as | 710 | <code>cosh(<var>x</var>)</code> is defined as |
| 722 | </p><div class="smallexample"> | 711 | </p><div class="example"> |
| 723 | <pre class="smallexample"> (exp(x) + exp(-x))/2 | 712 | <pre class="example"> (exp(x) + exp(-x))/2 |
| 724 | </pre></div> | 713 | </pre></div> |
| 725 | 714 | ||
| 726 | <p>Angles are specified in radians. | 715 | <p>Angles are specified in radians. |
| @@ -732,9 +721,6 @@ The computed value is returned. When the correct value would create | |||
| 732 | an overflow, <code>cosh</code> returns the value <code>HUGE_VAL</code> with the | 721 | an overflow, <code>cosh</code> returns the value <code>HUGE_VAL</code> with the |
| 733 | appropriate sign, and the global value <code>errno</code> is set to <code>ERANGE</code>. | 722 | appropriate sign, and the global value <code>errno</code> is set to <code>ERANGE</code>. |
| 734 | </p> | 723 | </p> |
| 735 | <p>You can modify error handling for these functions using the | ||
| 736 | function <code>matherr</code>. | ||
| 737 | </p> | ||
| 738 | <br> | 724 | <br> |
| 739 | <p><strong>Portability</strong><br> | 725 | <p><strong>Portability</strong><br> |
| 740 | <code>cosh</code> is ANSI. | 726 | <code>cosh</code> is ANSI. |
| @@ -742,17 +728,17 @@ function <code>matherr</code>. | |||
| 742 | </p> | 728 | </p> |
| 743 | <br> | 729 | <br> |
| 744 | <hr> | 730 | <hr> |
| 745 | <a name="erf"></a> | 731 | </div> |
| 732 | <div class="section" id="erf"> | ||
| 746 | <div class="header"> | 733 | <div class="header"> |
| 747 | <p> | 734 | <p> |
| 748 | Next: <a href="#exp" accesskey="n" rel="next">exp</a>, Previous: <a href="#cosh" accesskey="p" rel="previous">cosh</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 735 | Next: <a href="#exp" accesskey="n" rel="next"><code>exp</code>, <code>expf</code>—exponential</a>, Previous: <a href="#cosh" accesskey="p" rel="prev"><code>cosh</code>, <code>coshf</code>—hyperbolic cosine</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 749 | </div> | 736 | </div> |
| 750 | <a name="erf_002c-erff_002c-erfc_002c-erfcf_002d_002d_002derror-function"></a> | 737 | <span id="erf_002c-erff_002c-erfc_002c-erfcf_002d_002d_002derror-function"></span><h3 class="section">1.14 <code>erf</code>, <code>erff</code>, <code>erfc</code>, <code>erfcf</code>—error function</h3> |
| 751 | <h3 class="section">1.14 <code>erf</code>, <code>erff</code>, <code>erfc</code>, <code>erfcf</code>—error function</h3> | 738 | <span id="index-erf"></span> |
| 752 | <a name="index-erf"></a> | 739 | <span id="index-erff"></span> |
| 753 | <a name="index-erff"></a> | 740 | <span id="index-erfc"></span> |
| 754 | <a name="index-erfc"></a> | 741 | <span id="index-erfcf"></span> |
| 755 | <a name="index-erfcf"></a> | ||
| 756 | <p><strong>Synopsis</strong> | 742 | <p><strong>Synopsis</strong> |
| 757 | </p><div class="example"> | 743 | </p><div class="example"> |
| 758 | <pre class="example">#include <math.h> | 744 | <pre class="example">#include <math.h> |
| @@ -760,6 +746,7 @@ double erf(double <var>x</var>); | |||
| 760 | float erff(float <var>x</var>); | 746 | float erff(float <var>x</var>); |
| 761 | double erfc(double <var>x</var>); | 747 | double erfc(double <var>x</var>); |
| 762 | float erfcf(float <var>x</var>); | 748 | float erfcf(float <var>x</var>); |
| 749 | |||
| 763 | </pre></div> | 750 | </pre></div> |
| 764 | <p><strong>Description</strong><br> | 751 | <p><strong>Description</strong><br> |
| 765 | <code>erf</code> calculates an approximation to the “error function”, | 752 | <code>erf</code> calculates an approximation to the “error function”, |
| @@ -786,15 +773,15 @@ None of the variants of <code>erf</code> are ANSI C. | |||
| 786 | </p> | 773 | </p> |
| 787 | <br> | 774 | <br> |
| 788 | <hr> | 775 | <hr> |
| 789 | <a name="exp"></a> | 776 | </div> |
| 777 | <div class="section" id="exp"> | ||
| 790 | <div class="header"> | 778 | <div class="header"> |
| 791 | <p> | 779 | <p> |
| 792 | Next: <a href="#exp2" accesskey="n" rel="next">exp2</a>, Previous: <a href="#erf" accesskey="p" rel="previous">erf</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 780 | Next: <a href="#exp10" accesskey="n" rel="next"><code>exp10</code>, <code>exp10f</code>—exponential, base 10</a>, Previous: <a href="#erf" accesskey="p" rel="prev"><code>erf</code>, <code>erff</code>, <code>erfc</code>, <code>erfcf</code>—error function</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 793 | </div> | 781 | </div> |
| 794 | <a name="exp_002c-expf_002d_002d_002dexponential"></a> | 782 | <span id="exp_002c-expf_002d_002d_002dexponential"></span><h3 class="section">1.15 <code>exp</code>, <code>expf</code>—exponential</h3> |
| 795 | <h3 class="section">1.15 <code>exp</code>, <code>expf</code>—exponential</h3> | 783 | <span id="index-exp"></span> |
| 796 | <a name="index-exp"></a> | 784 | <span id="index-expf"></span> |
| 797 | <a name="index-expf"></a> | ||
| 798 | <p><strong>Synopsis</strong> | 785 | <p><strong>Synopsis</strong> |
| 799 | </p><div class="example"> | 786 | </p><div class="example"> |
| 800 | <pre class="example">#include <math.h> | 787 | <pre class="example">#include <math.h> |
| @@ -807,9 +794,6 @@ float expf(float <var>x</var>); | |||
| 807 | e raised to the power <var>x</var> (where e | 794 | e raised to the power <var>x</var> (where e |
| 808 | is the base of the natural system of logarithms, approximately 2.71828). | 795 | is the base of the natural system of logarithms, approximately 2.71828). |
| 809 | </p> | 796 | </p> |
| 810 | <p>You can use the (non-ANSI) function <code>matherr</code> to specify | ||
| 811 | error handling for these functions. | ||
| 812 | </p> | ||
| 813 | <br> | 797 | <br> |
| 814 | <p><strong>Returns</strong><br> | 798 | <p><strong>Returns</strong><br> |
| 815 | On success, <code>exp</code> and <code>expf</code> return the calculated value. | 799 | On success, <code>exp</code> and <code>expf</code> return the calculated value. |
| @@ -824,15 +808,49 @@ either case, <code>errno</code> is set to <code>ERANGE</code>. | |||
| 824 | 808 | ||
| 825 | <br> | 809 | <br> |
| 826 | <hr> | 810 | <hr> |
| 827 | <a name="exp2"></a> | 811 | </div> |
| 812 | <div class="section" id="exp10"> | ||
| 828 | <div class="header"> | 813 | <div class="header"> |
| 829 | <p> | 814 | <p> |
| 830 | Next: <a href="#expm1" accesskey="n" rel="next">expm1</a>, Previous: <a href="#exp" accesskey="p" rel="previous">exp</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 815 | Next: <a href="#exp2" accesskey="n" rel="next"><code>exp2</code>, <code>exp2f</code>—exponential, base 2</a>, Previous: <a href="#exp" accesskey="p" rel="prev"><code>exp</code>, <code>expf</code>—exponential</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 831 | </div> | 816 | </div> |
| 832 | <a name="exp2_002c-exp2f_002d_002dexponential_002c-base-2"></a> | 817 | <span id="exp10_002c-exp10f_002d_002d_002dexponential_002c-base-10"></span><h3 class="section">1.16 <code>exp10</code>, <code>exp10f</code>—exponential, base 10</h3> |
| 833 | <h3 class="section">1.16 <code>exp2</code>, <code>exp2f</code>–exponential, base 2</h3> | 818 | <span id="index-exp10"></span> |
| 834 | <a name="index-exp2"></a> | 819 | <span id="index-exp10f"></span> |
| 835 | <a name="index-exp2f"></a> | 820 | <p><strong>Synopsis</strong> |
| 821 | </p><div class="example"> | ||
| 822 | <pre class="example">#include <math.h> | ||
| 823 | double exp10(double <var>x</var>); | ||
| 824 | float exp10f(float <var>x</var>); | ||
| 825 | |||
| 826 | </pre></div> | ||
| 827 | <p><strong>Description</strong><br> | ||
| 828 | <code>exp10</code> and <code>exp10f</code> calculate 10 ^ <var>x</var>, that is, | ||
| 829 | 10 raised to the power <var>x</var>. | ||
| 830 | </p> | ||
| 831 | <br> | ||
| 832 | <p><strong>Returns</strong><br> | ||
| 833 | On success, <code>exp10</code> and <code>exp10f</code> return the calculated value. | ||
| 834 | If the result underflows, the returned value is <code>0</code>. If the | ||
| 835 | result overflows, the returned value is <code>HUGE_VAL</code>. In | ||
| 836 | either case, <code>errno</code> is set to <code>ERANGE</code>. | ||
| 837 | </p> | ||
| 838 | <br> | ||
| 839 | <p><strong>Portability</strong><br> | ||
| 840 | <code>exp10</code> and <code>exp10f</code> are GNU extensions. | ||
| 841 | </p> | ||
| 842 | |||
| 843 | <br> | ||
| 844 | <hr> | ||
| 845 | </div> | ||
| 846 | <div class="section" id="exp2"> | ||
| 847 | <div class="header"> | ||
| 848 | <p> | ||
| 849 | Next: <a href="#expm1" accesskey="n" rel="next"><code>expm1</code>, <code>expm1f</code>—exponential minus 1</a>, Previous: <a href="#exp10" accesskey="p" rel="prev"><code>exp10</code>, <code>exp10f</code>—exponential, base 10</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 850 | </div> | ||
| 851 | <span id="exp2_002c-exp2f_002d_002d_002dexponential_002c-base-2"></span><h3 class="section">1.17 <code>exp2</code>, <code>exp2f</code>—exponential, base 2</h3> | ||
| 852 | <span id="index-exp2"></span> | ||
| 853 | <span id="index-exp2f"></span> | ||
| 836 | <p><strong>Synopsis</strong> | 854 | <p><strong>Synopsis</strong> |
| 837 | </p><div class="example"> | 855 | </p><div class="example"> |
| 838 | <pre class="example">#include <math.h> | 856 | <pre class="example">#include <math.h> |
| @@ -844,9 +862,6 @@ float exp2f(float <var>x</var>); | |||
| 844 | <code>exp2</code> and <code>exp2f</code> calculate 2 ^ <var>x</var>, that is, | 862 | <code>exp2</code> and <code>exp2f</code> calculate 2 ^ <var>x</var>, that is, |
| 845 | 2 raised to the power <var>x</var>. | 863 | 2 raised to the power <var>x</var>. |
| 846 | </p> | 864 | </p> |
| 847 | <p>You can use the (non-ANSI) function <code>matherr</code> to specify | ||
| 848 | error handling for these functions. | ||
| 849 | </p> | ||
| 850 | <br> | 865 | <br> |
| 851 | <p><strong>Returns</strong><br> | 866 | <p><strong>Returns</strong><br> |
| 852 | On success, <code>exp2</code> and <code>exp2f</code> return the calculated value. | 867 | On success, <code>exp2</code> and <code>exp2f</code> return the calculated value. |
| @@ -861,15 +876,15 @@ ANSI C, POSIX. | |||
| 861 | 876 | ||
| 862 | <br> | 877 | <br> |
| 863 | <hr> | 878 | <hr> |
| 864 | <a name="expm1"></a> | 879 | </div> |
| 880 | <div class="section" id="expm1"> | ||
| 865 | <div class="header"> | 881 | <div class="header"> |
| 866 | <p> | 882 | <p> |
| 867 | Next: <a href="#fabs" accesskey="n" rel="next">fabs</a>, Previous: <a href="#exp2" accesskey="p" rel="previous">exp2</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 883 | Next: <a href="#fabs" accesskey="n" rel="next"><code>fabs</code>, <code>fabsf</code>—absolute value (magnitude)</a>, Previous: <a href="#exp2" accesskey="p" rel="prev"><code>exp2</code>, <code>exp2f</code>—exponential, base 2</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 868 | </div> | 884 | </div> |
| 869 | <a name="expm1_002c-expm1f_002d_002d_002dexponential-minus-1"></a> | 885 | <span id="expm1_002c-expm1f_002d_002d_002dexponential-minus-1"></span><h3 class="section">1.18 <code>expm1</code>, <code>expm1f</code>—exponential minus 1</h3> |
| 870 | <h3 class="section">1.17 <code>expm1</code>, <code>expm1f</code>—exponential minus 1</h3> | 886 | <span id="index-expm1"></span> |
| 871 | <a name="index-expm1"></a> | 887 | <span id="index-expm1f"></span> |
| 872 | <a name="index-expm1f"></a> | ||
| 873 | <p><strong>Synopsis</strong> | 888 | <p><strong>Synopsis</strong> |
| 874 | </p><div class="example"> | 889 | </p><div class="example"> |
| 875 | <pre class="example">#include <math.h> | 890 | <pre class="example">#include <math.h> |
| @@ -897,15 +912,15 @@ the System V Interface Definition (Issue 2). | |||
| 897 | </p> | 912 | </p> |
| 898 | <br> | 913 | <br> |
| 899 | <hr> | 914 | <hr> |
| 900 | <a name="fabs"></a> | 915 | </div> |
| 916 | <div class="section" id="fabs"> | ||
| 901 | <div class="header"> | 917 | <div class="header"> |
| 902 | <p> | 918 | <p> |
| 903 | Next: <a href="#fdim" accesskey="n" rel="next">fdim</a>, Previous: <a href="#expm1" accesskey="p" rel="previous">expm1</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 919 | Next: <a href="#fdim" accesskey="n" rel="next"><code>fdim</code>, <code>fdimf</code>—positive difference</a>, Previous: <a href="#expm1" accesskey="p" rel="prev"><code>expm1</code>, <code>expm1f</code>—exponential minus 1</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 904 | </div> | 920 | </div> |
| 905 | <a name="fabs_002c-fabsf_002d_002d_002dabsolute-value-_0028magnitude_0029"></a> | 921 | <span id="fabs_002c-fabsf_002d_002d_002dabsolute-value-_0028magnitude_0029"></span><h3 class="section">1.19 <code>fabs</code>, <code>fabsf</code>—absolute value (magnitude)</h3> |
| 906 | <h3 class="section">1.18 <code>fabs</code>, <code>fabsf</code>—absolute value (magnitude)</h3> | 922 | <span id="index-fabs"></span> |
| 907 | <a name="index-fabs"></a> | 923 | <span id="index-fabsf"></span> |
| 908 | <a name="index-fabsf"></a> | ||
| 909 | <p><strong>Synopsis</strong> | 924 | <p><strong>Synopsis</strong> |
| 910 | </p><div class="example"> | 925 | </p><div class="example"> |
| 911 | <pre class="example">#include <math.h> | 926 | <pre class="example">#include <math.h> |
| @@ -930,15 +945,15 @@ The calculated value is returned. No errors are detected. | |||
| 930 | 945 | ||
| 931 | <br> | 946 | <br> |
| 932 | <hr> | 947 | <hr> |
| 933 | <a name="fdim"></a> | 948 | </div> |
| 949 | <div class="section" id="fdim"> | ||
| 934 | <div class="header"> | 950 | <div class="header"> |
| 935 | <p> | 951 | <p> |
| 936 | Next: <a href="#floor" accesskey="n" rel="next">floor</a>, Previous: <a href="#fabs" accesskey="p" rel="previous">fabs</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 952 | Next: <a href="#floor" accesskey="n" rel="next"><code>floor</code>, <code>floorf</code>, <code>ceil</code>, <code>ceilf</code>—floor and ceiling</a>, Previous: <a href="#fabs" accesskey="p" rel="prev"><code>fabs</code>, <code>fabsf</code>—absolute value (magnitude)</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 937 | </div> | 953 | </div> |
| 938 | <a name="fdim_002c-fdimf_002d_002dpositive-difference"></a> | 954 | <span id="fdim_002c-fdimf_002d_002d_002dpositive-difference"></span><h3 class="section">1.20 <code>fdim</code>, <code>fdimf</code>—positive difference</h3> |
| 939 | <h3 class="section">1.19 <code>fdim</code>, <code>fdimf</code>–positive difference</h3> | 955 | <span id="index-fdim"></span> |
| 940 | <a name="index-fdim"></a> | 956 | <span id="index-fdimf"></span> |
| 941 | <a name="index-fdimf"></a> | ||
| 942 | <p><strong>Synopsis</strong> | 957 | <p><strong>Synopsis</strong> |
| 943 | </p><div class="example"> | 958 | </p><div class="example"> |
| 944 | <pre class="example">#include <math.h> | 959 | <pre class="example">#include <math.h> |
| @@ -949,14 +964,14 @@ float fdimf(float <var>x</var>, float <var>y</var>); | |||
| 949 | <p><strong>Description</strong><br> | 964 | <p><strong>Description</strong><br> |
| 950 | The <code>fdim</code> functions determine the positive difference between their | 965 | The <code>fdim</code> functions determine the positive difference between their |
| 951 | arguments, returning: | 966 | arguments, returning: |
| 952 | </p><div class="smallexample"> | 967 | </p><div class="example"> |
| 953 | <pre class="smallexample"> <var>x</var> - <var>y</var> if <var>x</var> > <var>y</var>, or | 968 | <pre class="example"> <var>x</var> - <var>y</var> if <var>x</var> > <var>y</var>, or |
| 954 | </pre></div> | 969 | </pre></div> |
| 955 | <div class="smallexample"> | 970 | <div class="example"> |
| 956 | <pre class="smallexample"> +0 if <var>x</var> <= <var>y</var>, or | 971 | <pre class="example"> +0 if <var>x</var> <= <var>y</var>, or |
| 957 | </pre></div> | 972 | </pre></div> |
| 958 | <div class="smallexample"> | 973 | <div class="example"> |
| 959 | <pre class="smallexample"> NAN if either argument is NAN. | 974 | <pre class="example"> NAN if either argument is NAN. |
| 960 | </pre></div> | 975 | </pre></div> |
| 961 | <p>A range error may occur. | 976 | <p>A range error may occur. |
| 962 | </p> | 977 | </p> |
| @@ -971,17 +986,17 @@ ANSI C, POSIX. | |||
| 971 | 986 | ||
| 972 | <br> | 987 | <br> |
| 973 | <hr> | 988 | <hr> |
| 974 | <a name="floor"></a> | 989 | </div> |
| 990 | <div class="section" id="floor"> | ||
| 975 | <div class="header"> | 991 | <div class="header"> |
| 976 | <p> | 992 | <p> |
| 977 | Next: <a href="#fma" accesskey="n" rel="next">fma</a>, Previous: <a href="#fdim" accesskey="p" rel="previous">fdim</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 993 | Next: <a href="#fma" accesskey="n" rel="next"><code>fma</code>, <code>fmaf</code>—floating multiply add</a>, Previous: <a href="#fdim" accesskey="p" rel="prev"><code>fdim</code>, <code>fdimf</code>—positive difference</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 978 | </div> | 994 | </div> |
| 979 | <a name="floor_002c-floorf_002c-ceil_002c-ceilf_002d_002d_002dfloor-and-ceiling"></a> | 995 | <span id="floor_002c-floorf_002c-ceil_002c-ceilf_002d_002d_002dfloor-and-ceiling"></span><h3 class="section">1.21 <code>floor</code>, <code>floorf</code>, <code>ceil</code>, <code>ceilf</code>—floor and ceiling</h3> |
| 980 | <h3 class="section">1.20 <code>floor</code>, <code>floorf</code>, <code>ceil</code>, <code>ceilf</code>—floor and ceiling</h3> | 996 | <span id="index-floor"></span> |
| 981 | <a name="index-floor"></a> | 997 | <span id="index-floorf"></span> |
| 982 | <a name="index-floorf"></a> | 998 | <span id="index-ceil"></span> |
| 983 | <a name="index-ceil"></a> | 999 | <span id="index-ceilf"></span> |
| 984 | <a name="index-ceilf"></a> | ||
| 985 | <p><strong>Synopsis</strong> | 1000 | <p><strong>Synopsis</strong> |
| 986 | </p><div class="example"> | 1001 | </p><div class="example"> |
| 987 | <pre class="example">#include <math.h> | 1002 | <pre class="example">#include <math.h> |
| @@ -1010,15 +1025,15 @@ the nearest integer greater than or equal to <var>x</var>. | |||
| 1010 | 1025 | ||
| 1011 | <br> | 1026 | <br> |
| 1012 | <hr> | 1027 | <hr> |
| 1013 | <a name="fma"></a> | 1028 | </div> |
| 1029 | <div class="section" id="fma"> | ||
| 1014 | <div class="header"> | 1030 | <div class="header"> |
| 1015 | <p> | 1031 | <p> |
| 1016 | Next: <a href="#fmax" accesskey="n" rel="next">fmax</a>, Previous: <a href="#floor" accesskey="p" rel="previous">floor</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1032 | Next: <a href="#fmax" accesskey="n" rel="next"><code>fmax</code>, <code>fmaxf</code>—maximum</a>, Previous: <a href="#floor" accesskey="p" rel="prev"><code>floor</code>, <code>floorf</code>, <code>ceil</code>, <code>ceilf</code>—floor and ceiling</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1017 | </div> | 1033 | </div> |
| 1018 | <a name="fma_002c-fmaf_002d_002dfloating-multiply-add"></a> | 1034 | <span id="fma_002c-fmaf_002d_002d_002dfloating-multiply-add"></span><h3 class="section">1.22 <code>fma</code>, <code>fmaf</code>—floating multiply add</h3> |
| 1019 | <h3 class="section">1.21 <code>fma</code>, <code>fmaf</code>–floating multiply add</h3> | 1035 | <span id="index-fma"></span> |
| 1020 | <a name="index-fma"></a> | 1036 | <span id="index-fmaf"></span> |
| 1021 | <a name="index-fmaf"></a> | ||
| 1022 | <p><strong>Synopsis</strong> | 1037 | <p><strong>Synopsis</strong> |
| 1023 | </p><div class="example"> | 1038 | </p><div class="example"> |
| 1024 | <pre class="example">#include <math.h> | 1039 | <pre class="example">#include <math.h> |
| @@ -1055,15 +1070,15 @@ ANSI C, POSIX. | |||
| 1055 | 1070 | ||
| 1056 | <br> | 1071 | <br> |
| 1057 | <hr> | 1072 | <hr> |
| 1058 | <a name="fmax"></a> | 1073 | </div> |
| 1074 | <div class="section" id="fmax"> | ||
| 1059 | <div class="header"> | 1075 | <div class="header"> |
| 1060 | <p> | 1076 | <p> |
| 1061 | Next: <a href="#fmin" accesskey="n" rel="next">fmin</a>, Previous: <a href="#fma" accesskey="p" rel="previous">fma</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1077 | Next: <a href="#fmin" accesskey="n" rel="next"><code>fmin</code>, <code>fminf</code>—minimum</a>, Previous: <a href="#fma" accesskey="p" rel="prev"><code>fma</code>, <code>fmaf</code>—floating multiply add</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1062 | </div> | 1078 | </div> |
| 1063 | <a name="fmax_002c-fmaxf_002d_002dmaximum"></a> | 1079 | <span id="fmax_002c-fmaxf_002d_002d_002dmaximum"></span><h3 class="section">1.23 <code>fmax</code>, <code>fmaxf</code>—maximum</h3> |
| 1064 | <h3 class="section">1.22 <code>fmax</code>, <code>fmaxf</code>–maximum</h3> | 1080 | <span id="index-fmax"></span> |
| 1065 | <a name="index-fmax"></a> | 1081 | <span id="index-fmaxf"></span> |
| 1066 | <a name="index-fmaxf"></a> | ||
| 1067 | <p><strong>Synopsis</strong> | 1082 | <p><strong>Synopsis</strong> |
| 1068 | </p><div class="example"> | 1083 | </p><div class="example"> |
| 1069 | <pre class="example">#include <math.h> | 1084 | <pre class="example">#include <math.h> |
| @@ -1087,15 +1102,15 @@ ANSI C, POSIX. | |||
| 1087 | 1102 | ||
| 1088 | <br> | 1103 | <br> |
| 1089 | <hr> | 1104 | <hr> |
| 1090 | <a name="fmin"></a> | 1105 | </div> |
| 1106 | <div class="section" id="fmin"> | ||
| 1091 | <div class="header"> | 1107 | <div class="header"> |
| 1092 | <p> | 1108 | <p> |
| 1093 | Next: <a href="#fmod" accesskey="n" rel="next">fmod</a>, Previous: <a href="#fmax" accesskey="p" rel="previous">fmax</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1109 | Next: <a href="#fmod" accesskey="n" rel="next"><code>fmod</code>, <code>fmodf</code>—floating-point remainder (modulo)</a>, Previous: <a href="#fmax" accesskey="p" rel="prev"><code>fmax</code>, <code>fmaxf</code>—maximum</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1094 | </div> | 1110 | </div> |
| 1095 | <a name="fmin_002c-fminf_002d_002dminimum"></a> | 1111 | <span id="fmin_002c-fminf_002d_002d_002dminimum"></span><h3 class="section">1.24 <code>fmin</code>, <code>fminf</code>—minimum</h3> |
| 1096 | <h3 class="section">1.23 <code>fmin</code>, <code>fminf</code>–minimum</h3> | 1112 | <span id="index-fmin"></span> |
| 1097 | <a name="index-fmin"></a> | 1113 | <span id="index-fminf"></span> |
| 1098 | <a name="index-fminf"></a> | ||
| 1099 | <p><strong>Synopsis</strong> | 1114 | <p><strong>Synopsis</strong> |
| 1100 | </p><div class="example"> | 1115 | </p><div class="example"> |
| 1101 | <pre class="example">#include <math.h> | 1116 | <pre class="example">#include <math.h> |
| @@ -1119,20 +1134,20 @@ ANSI C, POSIX. | |||
| 1119 | 1134 | ||
| 1120 | <br> | 1135 | <br> |
| 1121 | <hr> | 1136 | <hr> |
| 1122 | <a name="fmod"></a> | 1137 | </div> |
| 1138 | <div class="section" id="fmod"> | ||
| 1123 | <div class="header"> | 1139 | <div class="header"> |
| 1124 | <p> | 1140 | <p> |
| 1125 | Next: <a href="#frexp" accesskey="n" rel="next">frexp</a>, Previous: <a href="#fmin" accesskey="p" rel="previous">fmin</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1141 | Next: <a href="#frexp" accesskey="n" rel="next"><code>frexp</code>, <code>frexpf</code>—split floating-point number</a>, Previous: <a href="#fmin" accesskey="p" rel="prev"><code>fmin</code>, <code>fminf</code>—minimum</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1126 | </div> | 1142 | </div> |
| 1127 | <a name="fmod_002c-fmodf_002d_002d_002dfloating_002dpoint-remainder-_0028modulo_0029"></a> | 1143 | <span id="fmod_002c-fmodf_002d_002d_002dfloating_002dpoint-remainder-_0028modulo_0029"></span><h3 class="section">1.25 <code>fmod</code>, <code>fmodf</code>—floating-point remainder (modulo)</h3> |
| 1128 | <h3 class="section">1.24 <code>fmod</code>, <code>fmodf</code>—floating-point remainder (modulo)</h3> | 1144 | <span id="index-fmod"></span> |
| 1129 | <a name="index-fmod"></a> | 1145 | <span id="index-fmodf"></span> |
| 1130 | <a name="index-fmodf"></a> | ||
| 1131 | <p><strong>Synopsis</strong> | 1146 | <p><strong>Synopsis</strong> |
| 1132 | </p><div class="example"> | 1147 | </p><div class="example"> |
| 1133 | <pre class="example">#include <math.h> | 1148 | <pre class="example">#include <math.h> |
| 1134 | double fmod(double <var>x</var>, double <var>y</var>) | 1149 | double fmod(double <var>x</var>, double <var>y</var>); |
| 1135 | float fmodf(float <var>x</var>, float <var>y</var>) | 1150 | float fmodf(float <var>x</var>, float <var>y</var>); |
| 1136 | 1151 | ||
| 1137 | </pre></div> | 1152 | </pre></div> |
| 1138 | <p><strong>Description</strong><br> | 1153 | <p><strong>Description</strong><br> |
| @@ -1149,23 +1164,21 @@ magnitude of <var>y</var>. | |||
| 1149 | </p> | 1164 | </p> |
| 1150 | <p><code>fmod(<var>x</var>,0)</code> returns NaN, and sets <code>errno</code> to <code>EDOM</code>. | 1165 | <p><code>fmod(<var>x</var>,0)</code> returns NaN, and sets <code>errno</code> to <code>EDOM</code>. |
| 1151 | </p> | 1166 | </p> |
| 1152 | <p>You can modify error treatment for these functions using <code>matherr</code>. | ||
| 1153 | </p> | ||
| 1154 | <br> | 1167 | <br> |
| 1155 | <p><strong>Portability</strong><br> | 1168 | <p><strong>Portability</strong><br> |
| 1156 | <code>fmod</code> is ANSI C. <code>fmodf</code> is an extension. | 1169 | <code>fmod</code> is ANSI C. <code>fmodf</code> is an extension. |
| 1157 | </p> | 1170 | </p> |
| 1158 | <br> | 1171 | <br> |
| 1159 | <hr> | 1172 | <hr> |
| 1160 | <a name="frexp"></a> | 1173 | </div> |
| 1174 | <div class="section" id="frexp"> | ||
| 1161 | <div class="header"> | 1175 | <div class="header"> |
| 1162 | <p> | 1176 | <p> |
| 1163 | Next: <a href="#gamma" accesskey="n" rel="next">gamma</a>, Previous: <a href="#fmod" accesskey="p" rel="previous">fmod</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1177 | Next: <a href="#gamma" accesskey="n" rel="next"><code>gamma</code>, <code>gammaf</code>, <code>lgamma</code>, <code>lgammaf</code>, <code>gamma_r</code>, <code>gammaf_r</code>, <code>lgamma_r</code>, <code>lgammaf_r</code>, <code>tgamma</code>, and <code>tgammaf</code>—logarithmic and plain gamma functions</a>, Previous: <a href="#fmod" accesskey="p" rel="prev"><code>fmod</code>, <code>fmodf</code>—floating-point remainder (modulo)</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1164 | </div> | 1178 | </div> |
| 1165 | <a name="frexp_002c-frexpf_002d_002d_002dsplit-floating_002dpoint-number"></a> | 1179 | <span id="frexp_002c-frexpf_002d_002d_002dsplit-floating_002dpoint-number"></span><h3 class="section">1.26 <code>frexp</code>, <code>frexpf</code>—split floating-point number</h3> |
| 1166 | <h3 class="section">1.25 <code>frexp</code>, <code>frexpf</code>—split floating-point number</h3> | 1180 | <span id="index-frexp"></span> |
| 1167 | <a name="index-frexp"></a> | 1181 | <span id="index-frexpf"></span> |
| 1168 | <a name="index-frexpf"></a> | ||
| 1169 | <p><strong>Synopsis</strong> | 1182 | <p><strong>Synopsis</strong> |
| 1170 | </p><div class="example"> | 1183 | </p><div class="example"> |
| 1171 | <pre class="example">#include <math.h> | 1184 | <pre class="example">#include <math.h> |
| @@ -1200,23 +1213,23 @@ or Nan, <code>frexp</code> will set <code>*</code><var>exp</var> to <code>0</cod | |||
| 1200 | 1213 | ||
| 1201 | <br> | 1214 | <br> |
| 1202 | <hr> | 1215 | <hr> |
| 1203 | <a name="gamma"></a> | 1216 | </div> |
| 1217 | <div class="section" id="gamma"> | ||
| 1204 | <div class="header"> | 1218 | <div class="header"> |
| 1205 | <p> | 1219 | <p> |
| 1206 | Next: <a href="#hypot" accesskey="n" rel="next">hypot</a>, Previous: <a href="#frexp" accesskey="p" rel="previous">frexp</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1220 | Next: <a href="#hypot" accesskey="n" rel="next"><code>hypot</code>, <code>hypotf</code>—distance from origin</a>, Previous: <a href="#frexp" accesskey="p" rel="prev"><code>frexp</code>, <code>frexpf</code>—split floating-point number</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1207 | </div> | 1221 | </div> |
| 1208 | <a name="gamma_002c-gammaf_002c-lgamma_002c-lgammaf_002c-gamma_005fr_002c-gammaf_005fr_002c-lgamma_005fr_002c-lgammaf_005fr_002c-tgamma_002c-and-tgammaf_002d_002dlogarithmic-and-plain-gamma-functions"></a> | 1222 | <span id="gamma_002c-gammaf_002c-lgamma_002c-lgammaf_002c-gamma_005fr_002c-gammaf_005fr_002c-lgamma_005fr_002c-lgammaf_005fr_002c-tgamma_002c-and-tgammaf_002d_002d_002dlogarithmic-and-plain-gamma-functions"></span><h3 class="section">1.27 <code>gamma</code>, <code>gammaf</code>, <code>lgamma</code>, <code>lgammaf</code>, <code>gamma_r</code>, <code>gammaf_r</code>, <code>lgamma_r</code>, <code>lgammaf_r</code>, <code>tgamma</code>, and <code>tgammaf</code>—logarithmic and plain gamma functions</h3> |
| 1209 | <h3 class="section">1.26 <code>gamma</code>, <code>gammaf</code>, <code>lgamma</code>, <code>lgammaf</code>, <code>gamma_r</code>, <code>gammaf_r</code>, <code>lgamma_r</code>, <code>lgammaf_r</code>, <code>tgamma</code>, and <code>tgammaf</code>–logarithmic and plain gamma functions</h3> | 1223 | <span id="index-gamma"></span> |
| 1210 | <a name="index-gamma"></a> | 1224 | <span id="index-gammaf"></span> |
| 1211 | <a name="index-gammaf"></a> | 1225 | <span id="index-lgamma"></span> |
| 1212 | <a name="index-lgamma"></a> | 1226 | <span id="index-lgammaf"></span> |
| 1213 | <a name="index-lgammaf"></a> | 1227 | <span id="index-gamma_005fr"></span> |
| 1214 | <a name="index-gamma_005fr"></a> | 1228 | <span id="index-gammaf_005fr"></span> |
| 1215 | <a name="index-gammaf_005fr"></a> | 1229 | <span id="index-lgamma_005fr"></span> |
| 1216 | <a name="index-lgamma_005fr"></a> | 1230 | <span id="index-lgammaf_005fr"></span> |
| 1217 | <a name="index-lgammaf_005fr"></a> | 1231 | <span id="index-tgamma"></span> |
| 1218 | <a name="index-tgamma"></a> | 1232 | <span id="index-tgammaf"></span> |
| 1219 | <a name="index-tgammaf"></a> | ||
| 1220 | <p><strong>Synopsis</strong> | 1233 | <p><strong>Synopsis</strong> |
| 1221 | </p><div class="example"> | 1234 | </p><div class="example"> |
| 1222 | <pre class="example">#include <math.h> | 1235 | <pre class="example">#include <math.h> |
| @@ -1278,27 +1291,25 @@ Normally, the computed result is returned. | |||
| 1278 | and <code>errno</code> is set to <code>EDOM</code>. If the result overflows, <code>gamma</code> | 1291 | and <code>errno</code> is set to <code>EDOM</code>. If the result overflows, <code>gamma</code> |
| 1279 | returns <code>HUGE_VAL</code> and <code>errno</code> is set to <code>ERANGE</code>. | 1292 | returns <code>HUGE_VAL</code> and <code>errno</code> is set to <code>ERANGE</code>. |
| 1280 | </p> | 1293 | </p> |
| 1281 | <p>You can modify this error treatment using <code>matherr</code>. | ||
| 1282 | </p> | ||
| 1283 | <br> | 1294 | <br> |
| 1284 | <p><strong>Portability</strong><br> | 1295 | <p><strong>Portability</strong><br> |
| 1285 | Neither <code>gamma</code> nor <code>gammaf</code> is ANSI C. It is better not to use either | 1296 | Neither <code>gamma</code> nor <code>gammaf</code> is ANSI C. It is better not to use either |
| 1286 | of these; use <code>lgamma</code> or <code>tgamma</code> instead.<br> | 1297 | of these; use <code>lgamma</code> or <code>tgamma</code> instead.<br> |
| 1287 | <code>lgamma</code>, <code>lgammaf</code>, <code>tgamma</code>, and <code>tgammaf</code> are nominally C standard | 1298 | <code>lgamma</code>, <code>lgammaf</code>, <code>tgamma</code>, and <code>tgammaf</code> are nominally C standard |
| 1288 | in terms of the base return values, although the <code>matherr</code> error-handling | 1299 | in terms of the base return values, although the <var>signgam</var> global for |
| 1289 | is not standard, nor is the <var>signgam</var> global for <code>lgamma</code>. | 1300 | <code>lgamma</code> is not standard. |
| 1290 | </p> | 1301 | </p> |
| 1291 | <br> | 1302 | <br> |
| 1292 | <hr> | 1303 | <hr> |
| 1293 | <a name="hypot"></a> | 1304 | </div> |
| 1305 | <div class="section" id="hypot"> | ||
| 1294 | <div class="header"> | 1306 | <div class="header"> |
| 1295 | <p> | 1307 | <p> |
| 1296 | Next: <a href="#ilogb" accesskey="n" rel="next">ilogb</a>, Previous: <a href="#gamma" accesskey="p" rel="previous">gamma</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1308 | Next: <a href="#ilogb" accesskey="n" rel="next"><code>ilogb</code>, <code>ilogbf</code>—get exponent of floating-point number</a>, Previous: <a href="#gamma" accesskey="p" rel="prev"><code>gamma</code>, <code>gammaf</code>, <code>lgamma</code>, <code>lgammaf</code>, <code>gamma_r</code>, <code>gammaf_r</code>, <code>lgamma_r</code>, <code>lgammaf_r</code>, <code>tgamma</code>, and <code>tgammaf</code>—logarithmic and plain gamma functions</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1297 | </div> | 1309 | </div> |
| 1298 | <a name="hypot_002c-hypotf_002d_002d_002ddistance-from-origin"></a> | 1310 | <span id="hypot_002c-hypotf_002d_002d_002ddistance-from-origin"></span><h3 class="section">1.28 <code>hypot</code>, <code>hypotf</code>—distance from origin</h3> |
| 1299 | <h3 class="section">1.27 <code>hypot</code>, <code>hypotf</code>—distance from origin</h3> | 1311 | <span id="index-hypot"></span> |
| 1300 | <a name="index-hypot"></a> | 1312 | <span id="index-hypotf"></span> |
| 1301 | <a name="index-hypotf"></a> | ||
| 1302 | <p><strong>Synopsis</strong> | 1313 | <p><strong>Synopsis</strong> |
| 1303 | </p><div class="example"> | 1314 | </p><div class="example"> |
| 1304 | <pre class="example">#include <math.h> | 1315 | <pre class="example">#include <math.h> |
| @@ -1319,22 +1330,20 @@ Normally, the distance value is returned. On overflow, | |||
| 1319 | <code>hypot</code> returns <code>HUGE_VAL</code> and sets <code>errno</code> to | 1330 | <code>hypot</code> returns <code>HUGE_VAL</code> and sets <code>errno</code> to |
| 1320 | <code>ERANGE</code>. | 1331 | <code>ERANGE</code>. |
| 1321 | </p> | 1332 | </p> |
| 1322 | <p>You can change the error treatment with <code>matherr</code>. | ||
| 1323 | </p> | ||
| 1324 | <br> | 1333 | <br> |
| 1325 | <p><strong>Portability</strong><br> | 1334 | <p><strong>Portability</strong><br> |
| 1326 | <code>hypot</code> and <code>hypotf</code> are not ANSI C. | 1335 | <code>hypot</code> and <code>hypotf</code> are not ANSI C. |
| 1327 | <br> | 1336 | </p><br> |
| 1328 | </p><hr> | 1337 | <hr> |
| 1329 | <a name="ilogb"></a> | 1338 | </div> |
| 1339 | <div class="section" id="ilogb"> | ||
| 1330 | <div class="header"> | 1340 | <div class="header"> |
| 1331 | <p> | 1341 | <p> |
| 1332 | Next: <a href="#infinity" accesskey="n" rel="next">infinity</a>, Previous: <a href="#hypot" accesskey="p" rel="previous">hypot</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1342 | Next: <a href="#infinity" accesskey="n" rel="next"><code>infinity</code>, <code>infinityf</code>—representation of infinity</a>, Previous: <a href="#hypot" accesskey="p" rel="prev"><code>hypot</code>, <code>hypotf</code>—distance from origin</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1333 | </div> | 1343 | </div> |
| 1334 | <a name="ilogb_002c-ilogbf_002d_002d_002dget-exponent-of-floating_002dpoint-number"></a> | 1344 | <span id="ilogb_002c-ilogbf_002d_002d_002dget-exponent-of-floating_002dpoint-number"></span><h3 class="section">1.29 <code>ilogb</code>, <code>ilogbf</code>—get exponent of floating-point number</h3> |
| 1335 | <h3 class="section">1.28 <code>ilogb</code>, <code>ilogbf</code>—get exponent of floating-point number</h3> | 1345 | <span id="index-ilogb"></span> |
| 1336 | <a name="index-ilogb"></a> | 1346 | <span id="index-ilogbf"></span> |
| 1337 | <a name="index-ilogbf"></a> | ||
| 1338 | <p><strong>Synopsis</strong> | 1347 | <p><strong>Synopsis</strong> |
| 1339 | </p><div class="example"> | 1348 | </p><div class="example"> |
| 1340 | <pre class="example">#include <math.h> | 1349 | <pre class="example">#include <math.h> |
| @@ -1370,15 +1379,15 @@ C99, POSIX | |||
| 1370 | </p> | 1379 | </p> |
| 1371 | <br> | 1380 | <br> |
| 1372 | <hr> | 1381 | <hr> |
| 1373 | <a name="infinity"></a> | 1382 | </div> |
| 1383 | <div class="section" id="infinity"> | ||
| 1374 | <div class="header"> | 1384 | <div class="header"> |
| 1375 | <p> | 1385 | <p> |
| 1376 | Next: <a href="#isgreater" accesskey="n" rel="next">isgreater</a>, Previous: <a href="#ilogb" accesskey="p" rel="previous">ilogb</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1386 | Next: <a href="#isgreater" accesskey="n" rel="next"><code>isgreater</code>, <code>isgreaterequal</code>, <code>isless</code>, <code>islessequal</code>, <code>islessgreater</code>, and <code>isunordered</code>—comparison macros</a>, Previous: <a href="#ilogb" accesskey="p" rel="prev"><code>ilogb</code>, <code>ilogbf</code>—get exponent of floating-point number</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1377 | </div> | 1387 | </div> |
| 1378 | <a name="infinity_002c-infinityf_002d_002drepresentation-of-infinity"></a> | 1388 | <span id="infinity_002c-infinityf_002d_002d_002drepresentation-of-infinity"></span><h3 class="section">1.30 <code>infinity</code>, <code>infinityf</code>—representation of infinity</h3> |
| 1379 | <h3 class="section">1.29 <code>infinity</code>, <code>infinityf</code>–representation of infinity</h3> | 1389 | <span id="index-infinity"></span> |
| 1380 | <a name="index-infinity"></a> | 1390 | <span id="index-infinityf"></span> |
| 1381 | <a name="index-infinityf"></a> | ||
| 1382 | <p><strong>Synopsis</strong> | 1391 | <p><strong>Synopsis</strong> |
| 1383 | </p><div class="example"> | 1392 | </p><div class="example"> |
| 1384 | <pre class="example">#include <math.h> | 1393 | <pre class="example">#include <math.h> |
| @@ -1401,19 +1410,19 @@ infinities. | |||
| 1401 | </p> | 1410 | </p> |
| 1402 | <br> | 1411 | <br> |
| 1403 | <hr> | 1412 | <hr> |
| 1404 | <a name="isgreater"></a> | 1413 | </div> |
| 1414 | <div class="section" id="isgreater"> | ||
| 1405 | <div class="header"> | 1415 | <div class="header"> |
| 1406 | <p> | 1416 | <p> |
| 1407 | Next: <a href="#fpclassify" accesskey="n" rel="next">fpclassify</a>, Previous: <a href="#infinity" accesskey="p" rel="previous">infinity</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1417 | Next: <a href="#fpclassify" accesskey="n" rel="next"><code>fpclassify</code>, <code>isfinite</code>, <code>isinf</code>, <code>isnan</code>, and <code>isnormal</code>—floating-point classification macros; <code>finite</code>, <code>finitef</code>, <code>isinf</code>, <code>isinff</code>, <code>isnan</code>, <code>isnanf</code>—test for exceptional numbers</a>, Previous: <a href="#infinity" accesskey="p" rel="prev"><code>infinity</code>, <code>infinityf</code>—representation of infinity</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1408 | </div> | 1418 | </div> |
| 1409 | <a name="isgreater_002c-isgreaterequal_002c-isless_002c-islessequal_002c-islessgreater_002c-and-isunordered_002d_002dcomparison-macros"></a> | 1419 | <span id="isgreater_002c-isgreaterequal_002c-isless_002c-islessequal_002c-islessgreater_002c-and-isunordered_002d_002d_002dcomparison-macros"></span><h3 class="section">1.31 <code>isgreater</code>, <code>isgreaterequal</code>, <code>isless</code>, <code>islessequal</code>, <code>islessgreater</code>, and <code>isunordered</code>—comparison macros</h3> |
| 1410 | <h3 class="section">1.30 <code>isgreater</code>, <code>isgreaterequal</code>, <code>isless</code>, <code>islessequal</code>, <code>islessgreater</code>, and <code>isunordered</code>–comparison macros</h3> | 1420 | <span id="index-isgreater"></span> |
| 1411 | <a name="index-isgreater"></a> | 1421 | <span id="index-isgreaterequal"></span> |
| 1412 | <a name="index-isgreaterequal"></a> | 1422 | <span id="index-isless"></span> |
| 1413 | <a name="index-isless"></a> | 1423 | <span id="index-islessequal"></span> |
| 1414 | <a name="index-islessequal"></a> | 1424 | <span id="index-islessgreater"></span> |
| 1415 | <a name="index-islessgreater"></a> | 1425 | <span id="index-isunordered"></span> |
| 1416 | <a name="index-isunordered"></a> | ||
| 1417 | <p><strong>Synopsis</strong> | 1426 | <p><strong>Synopsis</strong> |
| 1418 | </p><div class="example"> | 1427 | </p><div class="example"> |
| 1419 | <pre class="example">#include <math.h> | 1428 | <pre class="example">#include <math.h> |
| @@ -1449,13 +1458,13 @@ exceptions, it is referring to the function that they are performing. It | |||
| 1449 | is certainly possible to give them an expression which causes an exception. | 1458 | is certainly possible to give them an expression which causes an exception. |
| 1450 | For example: | 1459 | For example: |
| 1451 | </p><dl compact="compact"> | 1460 | </p><dl compact="compact"> |
| 1452 | <dt><code>NaN < 1.0</code></dt> | 1461 | <dt><span><code>NaN < 1.0</code></span></dt> |
| 1453 | <dd><p>causes an "invalid" exception, | 1462 | <dd><p>causes an "invalid" exception, |
| 1454 | </p></dd> | 1463 | </p></dd> |
| 1455 | <dt><code>isless(NaN, 1.0)</code></dt> | 1464 | <dt><span><code>isless(NaN, 1.0)</code></span></dt> |
| 1456 | <dd><p>does not, and | 1465 | <dd><p>does not, and |
| 1457 | </p></dd> | 1466 | </p></dd> |
| 1458 | <dt><code>isless(NaN*0., 1.0)</code></dt> | 1467 | <dt><span><code>isless(NaN*0., 1.0)</code></span></dt> |
| 1459 | <dd><p>causes an exception due to the "NaN*0.", but not from the | 1468 | <dd><p>causes an exception due to the "NaN*0.", but not from the |
| 1460 | resultant reduced comparison of isless(NaN, 1.0). | 1469 | resultant reduced comparison of isless(NaN, 1.0). |
| 1461 | </p></dd> | 1470 | </p></dd> |
| @@ -1479,24 +1488,24 @@ C99, POSIX. | |||
| 1479 | 1488 | ||
| 1480 | <br> | 1489 | <br> |
| 1481 | <hr> | 1490 | <hr> |
| 1482 | <a name="fpclassify"></a> | 1491 | </div> |
| 1492 | <div class="section" id="fpclassify"> | ||
| 1483 | <div class="header"> | 1493 | <div class="header"> |
| 1484 | <p> | 1494 | <p> |
| 1485 | Next: <a href="#ldexp" accesskey="n" rel="next">ldexp</a>, Previous: <a href="#isgreater" accesskey="p" rel="previous">isgreater</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1495 | Next: <a href="#ldexp" accesskey="n" rel="next"><code>ldexp</code>, <code>ldexpf</code>—load exponent</a>, Previous: <a href="#isgreater" accesskey="p" rel="prev"><code>isgreater</code>, <code>isgreaterequal</code>, <code>isless</code>, <code>islessequal</code>, <code>islessgreater</code>, and <code>isunordered</code>—comparison macros</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1486 | </div> | 1496 | </div> |
| 1487 | <a name="fpclassify_002c-isfinite_002c-isinf_002c-isnan_002c-and-isnormal_002d_002dfloating_002dpoint-classification-macros_003b-finite_002c-finitef_002c-isinf_002c-isinff_002c-isnan_002c-isnanf_002d_002dtest-for-exceptional-numbers"></a> | 1497 | <span id="fpclassify_002c-isfinite_002c-isinf_002c-isnan_002c-and-isnormal_002d_002d_002dfloating_002dpoint-classification-macros_003b-finite_002c-finitef_002c-isinf_002c-isinff_002c-isnan_002c-isnanf_002d_002d_002dtest-for-exceptional-numbers"></span><h3 class="section">1.32 <code>fpclassify</code>, <code>isfinite</code>, <code>isinf</code>, <code>isnan</code>, and <code>isnormal</code>—floating-point classification macros; <code>finite</code>, <code>finitef</code>, <code>isinf</code>, <code>isinff</code>, <code>isnan</code>, <code>isnanf</code>—test for exceptional numbers</h3> |
| 1488 | <h3 class="section">1.31 <code>fpclassify</code>, <code>isfinite</code>, <code>isinf</code>, <code>isnan</code>, and <code>isnormal</code>–floating-point classification macros; <code>finite</code>, <code>finitef</code>, <code>isinf</code>, <code>isinff</code>, <code>isnan</code>, <code>isnanf</code>–test for exceptional numbers</h3> | 1498 | <span id="index-fpclassify"></span> |
| 1489 | <a name="index-fpclassify"></a> | 1499 | <span id="index-isfinite"></span> |
| 1490 | <a name="index-isfinite"></a> | 1500 | <span id="index-isinf"></span> |
| 1491 | <a name="index-isinf"></a> | 1501 | <span id="index-isnan"></span> |
| 1492 | <a name="index-isnan"></a> | 1502 | <span id="index-isnormal"></span> |
| 1493 | <a name="index-isnormal"></a> | 1503 | <span id="index-isnan-1"></span> |
| 1494 | <a name="index-isnan-1"></a> | 1504 | <span id="index-isinf-1"></span> |
| 1495 | <a name="index-isinf-1"></a> | 1505 | <span id="index-finite"></span> |
| 1496 | <a name="index-finite"></a> | 1506 | <span id="index-isnanf"></span> |
| 1497 | <a name="index-isnanf"></a> | 1507 | <span id="index-isinff"></span> |
| 1498 | <a name="index-isinff"></a> | 1508 | <span id="index-finitef"></span> |
| 1499 | <a name="index-finitef"></a> | ||
| 1500 | <p><strong>Synopsis</strong> | 1509 | <p><strong>Synopsis</strong> |
| 1501 | </p><div class="example"> | 1510 | </p><div class="example"> |
| 1502 | <pre class="example">[C99 standard macros:] | 1511 | <pre class="example">[C99 standard macros:] |
| @@ -1508,7 +1517,7 @@ int isnan(real-floating <var>x</var>); | |||
| 1508 | int isnormal(real-floating <var>x</var>); | 1517 | int isnormal(real-floating <var>x</var>); |
| 1509 | 1518 | ||
| 1510 | [Archaic SUSv2 functions:] | 1519 | [Archaic SUSv2 functions:] |
| 1511 | #include <ieeefp.h> | 1520 | #include <math.h> |
| 1512 | int isnan(double <var>arg</var>); | 1521 | int isnan(double <var>arg</var>); |
| 1513 | int isinf(double <var>arg</var>); | 1522 | int isinf(double <var>arg</var>); |
| 1514 | int finite(double <var>arg</var>); | 1523 | int finite(double <var>arg</var>); |
| @@ -1533,19 +1542,19 @@ The <code>fpclassify</code> macro returns the value of the number classification | |||
| 1533 | appropriate to the value of its argument: | 1542 | appropriate to the value of its argument: |
| 1534 | </p> | 1543 | </p> |
| 1535 | <dl compact="compact"> | 1544 | <dl compact="compact"> |
| 1536 | <dt><code>FP_INFINITE</code></dt> | 1545 | <dt><span><code>FP_INFINITE</code></span></dt> |
| 1537 | <dd><p><var>x</var> is either plus or minus infinity; | 1546 | <dd><p><var>x</var> is either plus or minus infinity; |
| 1538 | </p></dd> | 1547 | </p></dd> |
| 1539 | <dt><code>FP_NAN</code></dt> | 1548 | <dt><span><code>FP_NAN</code></span></dt> |
| 1540 | <dd><p><var>x</var> is "Not A Number" (plus or minus); | 1549 | <dd><p><var>x</var> is "Not A Number" (plus or minus); |
| 1541 | </p></dd> | 1550 | </p></dd> |
| 1542 | <dt><code>FP_NORMAL</code></dt> | 1551 | <dt><span><code>FP_NORMAL</code></span></dt> |
| 1543 | <dd><p><var>x</var> is a "normal" number (i.e. is none of the other special forms); | 1552 | <dd><p><var>x</var> is a "normal" number (i.e. is none of the other special forms); |
| 1544 | </p></dd> | 1553 | </p></dd> |
| 1545 | <dt><code>FP_SUBNORMAL</code></dt> | 1554 | <dt><span><code>FP_SUBNORMAL</code></span></dt> |
| 1546 | <dd><p><var>x</var> is too small be stored as a regular normalized number (i.e. loss of precision is likely); or | 1555 | <dd><p><var>x</var> is too small be stored as a regular normalized number (i.e. loss of precision is likely); or |
| 1547 | </p></dd> | 1556 | </p></dd> |
| 1548 | <dt><code>FP_ZERO</code></dt> | 1557 | <dt><span><code>FP_ZERO</code></span></dt> |
| 1549 | <dd><p><var>x</var> is 0 (either plus or minus). | 1558 | <dd><p><var>x</var> is 0 (either plus or minus). |
| 1550 | </p></dd> | 1559 | </p></dd> |
| 1551 | </dl> | 1560 | </dl> |
| @@ -1556,22 +1565,22 @@ classifying floating-point numbers, providing the following equivalent | |||
| 1556 | relations: | 1565 | relations: |
| 1557 | </p> | 1566 | </p> |
| 1558 | <dl compact="compact"> | 1567 | <dl compact="compact"> |
| 1559 | <dt><code><code>isfinite</code>(<var>x</var>)</code></dt> | 1568 | <dt><span><code><code>isfinite</code>(<var>x</var>)</code></span></dt> |
| 1560 | <dd><p>returns non-zero if <var>x</var> is finite. (It is equivalent to | 1569 | <dd><p>returns non-zero if <var>x</var> is finite. (It is equivalent to |
| 1561 | (<code>fpclassify</code>(<var>x</var>) != FP_INFINITE && <code>fpclassify</code>(<var>x</var>) != FP_NAN).) | 1570 | (<code>fpclassify</code>(<var>x</var>) != FP_INFINITE && <code>fpclassify</code>(<var>x</var>) != FP_NAN).) |
| 1562 | </p> | 1571 | </p> |
| 1563 | </dd> | 1572 | </dd> |
| 1564 | <dt><code><code>isinf</code>(<var>x</var>)</code></dt> | 1573 | <dt><span><code><code>isinf</code>(<var>x</var>)</code></span></dt> |
| 1565 | <dd><p>returns non-zero if <var>x</var> is infinite. (It is equivalent to | 1574 | <dd><p>returns non-zero if <var>x</var> is infinite. (It is equivalent to |
| 1566 | (<code>fpclassify</code>(<var>x</var>) == FP_INFINITE).) | 1575 | (<code>fpclassify</code>(<var>x</var>) == FP_INFINITE).) |
| 1567 | </p> | 1576 | </p> |
| 1568 | </dd> | 1577 | </dd> |
| 1569 | <dt><code><code>isnan</code>(<var>x</var>)</code></dt> | 1578 | <dt><span><code><code>isnan</code>(<var>x</var>)</code></span></dt> |
| 1570 | <dd><p>returns non-zero if <var>x</var> is NaN. (It is equivalent to | 1579 | <dd><p>returns non-zero if <var>x</var> is NaN. (It is equivalent to |
| 1571 | (<code>fpclassify</code>(<var>x</var>) == FP_NAN).) | 1580 | (<code>fpclassify</code>(<var>x</var>) == FP_NAN).) |
| 1572 | </p> | 1581 | </p> |
| 1573 | </dd> | 1582 | </dd> |
| 1574 | <dt><code><code>isnormal</code>(<var>x</var>)</code></dt> | 1583 | <dt><span><code><code>isnormal</code>(<var>x</var>)</code></span></dt> |
| 1575 | <dd><p>returns non-zero if <var>x</var> is normal. (It is equivalent to | 1584 | <dd><p>returns non-zero if <var>x</var> is normal. (It is equivalent to |
| 1576 | (<code>fpclassify</code>(<var>x</var>) == FP_NORMAL).) | 1585 | (<code>fpclassify</code>(<var>x</var>) == FP_NORMAL).) |
| 1577 | </p></dd> | 1586 | </p></dd> |
| @@ -1584,19 +1593,19 @@ argument supplied. | |||
| 1584 | <p>There are five major number formats ("exponent" referring to the | 1593 | <p>There are five major number formats ("exponent" referring to the |
| 1585 | biased exponent in the binary-encoded number): | 1594 | biased exponent in the binary-encoded number): |
| 1586 | </p><dl compact="compact"> | 1595 | </p><dl compact="compact"> |
| 1587 | <dt><code>zero</code></dt> | 1596 | <dt><span><code>zero</code></span></dt> |
| 1588 | <dd><p>A number which contains all zero bits, excluding the sign bit. | 1597 | <dd><p>A number which contains all zero bits, excluding the sign bit. |
| 1589 | </p></dd> | 1598 | </p></dd> |
| 1590 | <dt><code>subnormal</code></dt> | 1599 | <dt><span><code>subnormal</code></span></dt> |
| 1591 | <dd><p>A number with a zero exponent but a nonzero fraction. | 1600 | <dd><p>A number with a zero exponent but a nonzero fraction. |
| 1592 | </p></dd> | 1601 | </p></dd> |
| 1593 | <dt><code>normal</code></dt> | 1602 | <dt><span><code>normal</code></span></dt> |
| 1594 | <dd><p>A number with an exponent and a fraction. | 1603 | <dd><p>A number with an exponent and a fraction. |
| 1595 | </p></dd> | 1604 | </p></dd> |
| 1596 | <dt><code>infinity</code></dt> | 1605 | <dt><span><code>infinity</code></span></dt> |
| 1597 | <dd><p>A number with an all 1’s exponent and a zero fraction. | 1606 | <dd><p>A number with an all 1’s exponent and a zero fraction. |
| 1598 | </p></dd> | 1607 | </p></dd> |
| 1599 | <dt><code>NAN</code></dt> | 1608 | <dt><span><code>NAN</code></span></dt> |
| 1600 | <dd><p>A number with an all 1’s exponent and a nonzero fraction. | 1609 | <dd><p>A number with an all 1’s exponent and a nonzero fraction. |
| 1601 | </p> | 1610 | </p> |
| 1602 | </dd> | 1611 | </dd> |
| @@ -1614,7 +1623,7 @@ counterparts, but on single-precision floating-point numbers. | |||
| 1614 | and <code>isinf</code> are macros that operate on multiple types of | 1623 | and <code>isinf</code> are macros that operate on multiple types of |
| 1615 | floating-point. The SUSv2 standard declares <code>isnan</code> as | 1624 | floating-point. The SUSv2 standard declares <code>isnan</code> as |
| 1616 | a function taking double. Newlib has decided to declare | 1625 | a function taking double. Newlib has decided to declare |
| 1617 | them both as macros in math.h and as functions in ieeefp.h to | 1626 | them both as functions and as macros in math.h to |
| 1618 | maintain backward compatibility. | 1627 | maintain backward compatibility. |
| 1619 | </p> | 1628 | </p> |
| 1620 | <br> | 1629 | <br> |
| @@ -1627,21 +1636,23 @@ The isnormal macro returns nonzero if <var>x</var> has a normal value, else 0. | |||
| 1627 | </p> | 1636 | </p> |
| 1628 | <br> | 1637 | <br> |
| 1629 | <p><strong>Portability</strong><br> | 1638 | <p><strong>Portability</strong><br> |
| 1630 | math.h macros are C99, POSIX. | 1639 | math.h macros are C99, POSIX.1-2001. |
| 1631 | </p> | 1640 | </p> |
| 1632 | <p>ieeefp.h funtions are outdated and should be avoided. | 1641 | <p>The functions originate from BSD; isnan was listed in the X/Open |
| 1642 | Portability Guide and Single Unix Specification, but was dropped when | ||
| 1643 | the macro was standardized in POSIX.1-2001. | ||
| 1633 | </p> | 1644 | </p> |
| 1634 | <br> | 1645 | <br> |
| 1635 | <hr> | 1646 | <hr> |
| 1636 | <a name="ldexp"></a> | 1647 | </div> |
| 1648 | <div class="section" id="ldexp"> | ||
| 1637 | <div class="header"> | 1649 | <div class="header"> |
| 1638 | <p> | 1650 | <p> |
| 1639 | Next: <a href="#log" accesskey="n" rel="next">log</a>, Previous: <a href="#fpclassify" accesskey="p" rel="previous">fpclassify</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1651 | Next: <a href="#log" accesskey="n" rel="next"><code>log</code>, <code>logf</code>—natural logarithms</a>, Previous: <a href="#fpclassify" accesskey="p" rel="prev"><code>fpclassify</code>, <code>isfinite</code>, <code>isinf</code>, <code>isnan</code>, and <code>isnormal</code>—floating-point classification macros; <code>finite</code>, <code>finitef</code>, <code>isinf</code>, <code>isinff</code>, <code>isnan</code>, <code>isnanf</code>—test for exceptional numbers</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1640 | </div> | 1652 | </div> |
| 1641 | <a name="ldexp_002c-ldexpf_002d_002d_002dload-exponent"></a> | 1653 | <span id="ldexp_002c-ldexpf_002d_002d_002dload-exponent"></span><h3 class="section">1.33 <code>ldexp</code>, <code>ldexpf</code>—load exponent</h3> |
| 1642 | <h3 class="section">1.32 <code>ldexp</code>, <code>ldexpf</code>—load exponent</h3> | 1654 | <span id="index-ldexp"></span> |
| 1643 | <a name="index-ldexp"></a> | 1655 | <span id="index-ldexpf"></span> |
| 1644 | <a name="index-ldexpf"></a> | ||
| 1645 | <p><strong>Synopsis</strong> | 1656 | <p><strong>Synopsis</strong> |
| 1646 | </p><div class="example"> | 1657 | </p><div class="example"> |
| 1647 | <pre class="example">#include <math.h> | 1658 | <pre class="example">#include <math.h> |
| @@ -1669,15 +1680,15 @@ On overflow, <code>ldexp</code> returns plus or minus <code>HUGE_VAL</code>. | |||
| 1669 | </p> | 1680 | </p> |
| 1670 | <br> | 1681 | <br> |
| 1671 | <hr> | 1682 | <hr> |
| 1672 | <a name="log"></a> | 1683 | </div> |
| 1684 | <div class="section" id="log"> | ||
| 1673 | <div class="header"> | 1685 | <div class="header"> |
| 1674 | <p> | 1686 | <p> |
| 1675 | Next: <a href="#log10" accesskey="n" rel="next">log10</a>, Previous: <a href="#ldexp" accesskey="p" rel="previous">ldexp</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1687 | Next: <a href="#log10" accesskey="n" rel="next"><code>log10</code>, <code>log10f</code>—base 10 logarithms</a>, Previous: <a href="#ldexp" accesskey="p" rel="prev"><code>ldexp</code>, <code>ldexpf</code>—load exponent</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1676 | </div> | 1688 | </div> |
| 1677 | <a name="log_002c-logf_002d_002d_002dnatural-logarithms"></a> | 1689 | <span id="log_002c-logf_002d_002d_002dnatural-logarithms"></span><h3 class="section">1.34 <code>log</code>, <code>logf</code>—natural logarithms</h3> |
| 1678 | <h3 class="section">1.33 <code>log</code>, <code>logf</code>—natural logarithms</h3> | 1690 | <span id="index-log"></span> |
| 1679 | <a name="index-log"></a> | 1691 | <span id="index-logf"></span> |
| 1680 | <a name="index-logf"></a> | ||
| 1681 | <p><strong>Synopsis</strong> | 1692 | <p><strong>Synopsis</strong> |
| 1682 | </p><div class="example"> | 1693 | </p><div class="example"> |
| 1683 | <pre class="example">#include <math.h> | 1694 | <pre class="example">#include <math.h> |
| @@ -1690,16 +1701,12 @@ Return the natural logarithm of <var>x</var>, that is, its logarithm base e | |||
| 1690 | (where e is the base of the natural system of logarithms, 2.71828…). | 1701 | (where e is the base of the natural system of logarithms, 2.71828…). |
| 1691 | <code>log</code> and <code>logf</code> are identical save for the return and argument types. | 1702 | <code>log</code> and <code>logf</code> are identical save for the return and argument types. |
| 1692 | </p> | 1703 | </p> |
| 1693 | <p>You can use the (non-ANSI) function <code>matherr</code> to specify error | ||
| 1694 | handling for these functions. | ||
| 1695 | </p> | ||
| 1696 | <br> | 1704 | <br> |
| 1697 | <p><strong>Returns</strong><br> | 1705 | <p><strong>Returns</strong><br> |
| 1698 | Normally, returns the calculated value. When <var>x</var> is zero, the | 1706 | Normally, returns the calculated value. When <var>x</var> is zero, the |
| 1699 | returned value is <code>-HUGE_VAL</code> and <code>errno</code> is set to <code>ERANGE</code>. | 1707 | returned value is <code>-HUGE_VAL</code> and <code>errno</code> is set to <code>ERANGE</code>. |
| 1700 | When <var>x</var> is negative, the returned value is NaN (not a number) and | 1708 | When <var>x</var> is negative, the returned value is NaN (not a number) and |
| 1701 | <code>errno</code> is set to <code>EDOM</code>. You can control the error behavior via | 1709 | <code>errno</code> is set to <code>EDOM</code>. |
| 1702 | <code>matherr</code>. | ||
| 1703 | </p> | 1710 | </p> |
| 1704 | <br> | 1711 | <br> |
| 1705 | <p><strong>Portability</strong><br> | 1712 | <p><strong>Portability</strong><br> |
| @@ -1707,15 +1714,15 @@ When <var>x</var> is negative, the returned value is NaN (not a number) and | |||
| 1707 | </p> | 1714 | </p> |
| 1708 | <br> | 1715 | <br> |
| 1709 | <hr> | 1716 | <hr> |
| 1710 | <a name="log10"></a> | 1717 | </div> |
| 1718 | <div class="section" id="log10"> | ||
| 1711 | <div class="header"> | 1719 | <div class="header"> |
| 1712 | <p> | 1720 | <p> |
| 1713 | Next: <a href="#log1p" accesskey="n" rel="next">log1p</a>, Previous: <a href="#log" accesskey="p" rel="previous">log</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1721 | Next: <a href="#log1p" accesskey="n" rel="next"><code>log1p</code>, <code>log1pf</code>—log of <code>1 + <var>x</var></code></a>, Previous: <a href="#log" accesskey="p" rel="prev"><code>log</code>, <code>logf</code>—natural logarithms</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1714 | </div> | 1722 | </div> |
| 1715 | <a name="log10_002c-log10f_002d_002d_002dbase-10-logarithms"></a> | 1723 | <span id="log10_002c-log10f_002d_002d_002dbase-10-logarithms"></span><h3 class="section">1.35 <code>log10</code>, <code>log10f</code>—base 10 logarithms</h3> |
| 1716 | <h3 class="section">1.34 <code>log10</code>, <code>log10f</code>—base 10 logarithms</h3> | 1724 | <span id="index-log10"></span> |
| 1717 | <a name="index-log10"></a> | 1725 | <span id="index-log10f"></span> |
| 1718 | <a name="index-log10f"></a> | ||
| 1719 | <p><strong>Synopsis</strong> | 1726 | <p><strong>Synopsis</strong> |
| 1720 | </p><div class="example"> | 1727 | </p><div class="example"> |
| 1721 | <pre class="example">#include <math.h> | 1728 | <pre class="example">#include <math.h> |
| @@ -1742,15 +1749,15 @@ It is implemented as <code>log(<var>x</var>) / log(10)</code>. | |||
| 1742 | 1749 | ||
| 1743 | <br> | 1750 | <br> |
| 1744 | <hr> | 1751 | <hr> |
| 1745 | <a name="log1p"></a> | 1752 | </div> |
| 1753 | <div class="section" id="log1p"> | ||
| 1746 | <div class="header"> | 1754 | <div class="header"> |
| 1747 | <p> | 1755 | <p> |
| 1748 | Next: <a href="#log2" accesskey="n" rel="next">log2</a>, Previous: <a href="#log10" accesskey="p" rel="previous">log10</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1756 | Next: <a href="#log2" accesskey="n" rel="next"><code>log2</code>, <code>log2f</code>—base 2 logarithm</a>, Previous: <a href="#log10" accesskey="p" rel="prev"><code>log10</code>, <code>log10f</code>—base 10 logarithms</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1749 | </div> | 1757 | </div> |
| 1750 | <a name="log1p_002c-log1pf_002d_002d_002dlog-of-1-_002b-x"></a> | 1758 | <span id="log1p_002c-log1pf_002d_002d_002dlog-of-1-_002b-x"></span><h3 class="section">1.36 <code>log1p</code>, <code>log1pf</code>—log of <code>1 + <var>x</var></code></h3> |
| 1751 | <h3 class="section">1.35 <code>log1p</code>, <code>log1pf</code>—log of <code>1 + <var>x</var></code></h3> | 1759 | <span id="index-log1p"></span> |
| 1752 | <a name="index-log1p"></a> | 1760 | <span id="index-log1pf"></span> |
| 1753 | <a name="index-log1pf"></a> | ||
| 1754 | <p><strong>Synopsis</strong> | 1761 | <p><strong>Synopsis</strong> |
| 1755 | </p><div class="example"> | 1762 | </p><div class="example"> |
| 1756 | <pre class="example">#include <math.h> | 1763 | <pre class="example">#include <math.h> |
| @@ -1780,15 +1787,15 @@ Interface Definition (Issue 2). | |||
| 1780 | 1787 | ||
| 1781 | <br> | 1788 | <br> |
| 1782 | <hr> | 1789 | <hr> |
| 1783 | <a name="log2"></a> | 1790 | </div> |
| 1791 | <div class="section" id="log2"> | ||
| 1784 | <div class="header"> | 1792 | <div class="header"> |
| 1785 | <p> | 1793 | <p> |
| 1786 | Next: <a href="#logb" accesskey="n" rel="next">logb</a>, Previous: <a href="#log1p" accesskey="p" rel="previous">log1p</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1794 | Next: <a href="#logb" accesskey="n" rel="next"><code>logb</code>, <code>logbf</code>—get exponent of floating-point number</a>, Previous: <a href="#log1p" accesskey="p" rel="prev"><code>log1p</code>, <code>log1pf</code>—log of <code>1 + <var>x</var></code></a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1787 | </div> | 1795 | </div> |
| 1788 | <a name="log2_002c-log2f_002d_002dbase-2-logarithm"></a> | 1796 | <span id="log2_002c-log2f_002d_002d_002dbase-2-logarithm"></span><h3 class="section">1.37 <code>log2</code>, <code>log2f</code>—base 2 logarithm</h3> |
| 1789 | <h3 class="section">1.36 <code>log2</code>, <code>log2f</code>–base 2 logarithm</h3> | 1797 | <span id="index-log2"></span> |
| 1790 | <a name="index-log2"></a> | 1798 | <span id="index-log2f"></span> |
| 1791 | <a name="index-log2f"></a> | ||
| 1792 | <p><strong>Synopsis</strong> | 1799 | <p><strong>Synopsis</strong> |
| 1793 | </p><div class="example"> | 1800 | </p><div class="example"> |
| 1794 | <pre class="example">#include <math.h> | 1801 | <pre class="example">#include <math.h> |
| @@ -1805,16 +1812,12 @@ argument is zero. | |||
| 1805 | rather are derivatives based on <code>log</code>. (Accuracy might be slightly off from | 1812 | rather are derivatives based on <code>log</code>. (Accuracy might be slightly off from |
| 1806 | a direct calculation.) In addition to functions, they are also implemented as | 1813 | a direct calculation.) In addition to functions, they are also implemented as |
| 1807 | macros defined in math.h: | 1814 | macros defined in math.h: |
| 1808 | </p><div class="smallexample"> | 1815 | </p><div class="example"> |
| 1809 | <pre class="smallexample"> #define log2(x) (log (x) / _M_LN2) | 1816 | <pre class="example"> #define log2(x) (log (x) / _M_LN2) |
| 1810 | #define log2f(x) (logf (x) / (float) _M_LN2) | 1817 | #define log2f(x) (logf (x) / (float) _M_LN2) |
| 1811 | </pre></div> | 1818 | </pre></div> |
| 1812 | <p>To use the functions instead, just undefine the macros first. | 1819 | <p>To use the functions instead, just undefine the macros first. |
| 1813 | </p> | 1820 | </p> |
| 1814 | <p>You can use the (non-ANSI) function <code>matherr</code> to specify error | ||
| 1815 | handling for these functions, indirectly through the respective <code>log</code> | ||
| 1816 | function. | ||
| 1817 | </p> | ||
| 1818 | <br> | 1821 | <br> |
| 1819 | <p><strong>Returns</strong><br> | 1822 | <p><strong>Returns</strong><br> |
| 1820 | The <code>log2</code> functions return | 1823 | The <code>log2</code> functions return |
| @@ -1823,8 +1826,7 @@ on success. | |||
| 1823 | When <var>x</var> is zero, the | 1826 | When <var>x</var> is zero, the |
| 1824 | returned value is <code>-HUGE_VAL</code> and <code>errno</code> is set to <code>ERANGE</code>. | 1827 | returned value is <code>-HUGE_VAL</code> and <code>errno</code> is set to <code>ERANGE</code>. |
| 1825 | When <var>x</var> is negative, the returned value is NaN (not a number) and | 1828 | When <var>x</var> is negative, the returned value is NaN (not a number) and |
| 1826 | <code>errno</code> is set to <code>EDOM</code>. You can control the error behavior via | 1829 | <code>errno</code> is set to <code>EDOM</code>. |
| 1827 | <code>matherr</code>. | ||
| 1828 | </p> | 1830 | </p> |
| 1829 | <br> | 1831 | <br> |
| 1830 | <p><strong>Portability</strong><br> | 1832 | <p><strong>Portability</strong><br> |
| @@ -1832,15 +1834,15 @@ C99, POSIX, System V Interface Definition (Issue 6). | |||
| 1832 | </p> | 1834 | </p> |
| 1833 | <br> | 1835 | <br> |
| 1834 | <hr> | 1836 | <hr> |
| 1835 | <a name="logb"></a> | 1837 | </div> |
| 1838 | <div class="section" id="logb"> | ||
| 1836 | <div class="header"> | 1839 | <div class="header"> |
| 1837 | <p> | 1840 | <p> |
| 1838 | Next: <a href="#lrint" accesskey="n" rel="next">lrint</a>, Previous: <a href="#log2" accesskey="p" rel="previous">log2</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1841 | Next: <a href="#lrint" accesskey="n" rel="next"><code>lrint</code>, <code>lrintf</code>, <code>llrint</code>, <code>llrintf</code>—round to integer</a>, Previous: <a href="#log2" accesskey="p" rel="prev"><code>log2</code>, <code>log2f</code>—base 2 logarithm</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1839 | </div> | 1842 | </div> |
| 1840 | <a name="logb_002c-logbf_002d_002dget-exponent-of-floating_002dpoint-number"></a> | 1843 | <span id="logb_002c-logbf_002d_002d_002dget-exponent-of-floating_002dpoint-number"></span><h3 class="section">1.38 <code>logb</code>, <code>logbf</code>—get exponent of floating-point number</h3> |
| 1841 | <h3 class="section">1.37 <code>logb</code>, <code>logbf</code>–get exponent of floating-point number</h3> | 1844 | <span id="index-logb"></span> |
| 1842 | <a name="index-logb"></a> | 1845 | <span id="index-logbf"></span> |
| 1843 | <a name="index-logbf"></a> | ||
| 1844 | <p><strong>Synopsis</strong> | 1846 | <p><strong>Synopsis</strong> |
| 1845 | </p><div class="example"> | 1847 | </p><div class="example"> |
| 1846 | <pre class="example">#include <math.h> | 1848 | <pre class="example">#include <math.h> |
| @@ -1881,17 +1883,17 @@ frexp, ilogb | |||
| 1881 | </p> | 1883 | </p> |
| 1882 | <br> | 1884 | <br> |
| 1883 | <hr> | 1885 | <hr> |
| 1884 | <a name="lrint"></a> | 1886 | </div> |
| 1887 | <div class="section" id="lrint"> | ||
| 1885 | <div class="header"> | 1888 | <div class="header"> |
| 1886 | <p> | 1889 | <p> |
| 1887 | Next: <a href="#lround" accesskey="n" rel="next">lround</a>, Previous: <a href="#logb" accesskey="p" rel="previous">logb</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1890 | Next: <a href="#lround" accesskey="n" rel="next"><code>lround</code>, <code>lroundf</code>, <code>llround</code>, <code>llroundf</code>—round to integer, to nearest</a>, Previous: <a href="#logb" accesskey="p" rel="prev"><code>logb</code>, <code>logbf</code>—get exponent of floating-point number</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1888 | </div> | 1891 | </div> |
| 1889 | <a name="lrint_002c-lrintf_002c-llrint_002c-llrintf_002d_002dround-to-integer"></a> | 1892 | <span id="lrint_002c-lrintf_002c-llrint_002c-llrintf_002d_002d_002dround-to-integer"></span><h3 class="section">1.39 <code>lrint</code>, <code>lrintf</code>, <code>llrint</code>, <code>llrintf</code>—round to integer</h3> |
| 1890 | <h3 class="section">1.38 <code>lrint</code>, <code>lrintf</code>, <code>llrint</code>, <code>llrintf</code>–round to integer</h3> | 1893 | <span id="index-lrint"></span> |
| 1891 | <a name="index-lrint"></a> | 1894 | <span id="index-lrintf"></span> |
| 1892 | <a name="index-lrintf"></a> | 1895 | <span id="index-llrint"></span> |
| 1893 | <a name="index-llrint"></a> | 1896 | <span id="index-llrintf"></span> |
| 1894 | <a name="index-llrintf"></a> | ||
| 1895 | <p><strong>Synopsis</strong> | 1897 | <p><strong>Synopsis</strong> |
| 1896 | </p><div class="example"> | 1898 | </p><div class="example"> |
| 1897 | <pre class="example">#include <math.h> | 1899 | <pre class="example">#include <math.h> |
| @@ -1925,17 +1927,17 @@ ANSI C, POSIX | |||
| 1925 | 1927 | ||
| 1926 | <br> | 1928 | <br> |
| 1927 | <hr> | 1929 | <hr> |
| 1928 | <a name="lround"></a> | 1930 | </div> |
| 1931 | <div class="section" id="lround"> | ||
| 1929 | <div class="header"> | 1932 | <div class="header"> |
| 1930 | <p> | 1933 | <p> |
| 1931 | Next: <a href="#matherr" accesskey="n" rel="next">matherr</a>, Previous: <a href="#lrint" accesskey="p" rel="previous">lrint</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1934 | Next: <a href="#modf" accesskey="n" rel="next"><code>modf</code>, <code>modff</code>—split fractional and integer parts</a>, Previous: <a href="#lrint" accesskey="p" rel="prev"><code>lrint</code>, <code>lrintf</code>, <code>llrint</code>, <code>llrintf</code>—round to integer</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 1932 | </div> | 1935 | </div> |
| 1933 | <a name="lround_002c-lroundf_002c-llround_002c-llroundf_002d_002dround-to-integer_002c-to-nearest"></a> | 1936 | <span id="lround_002c-lroundf_002c-llround_002c-llroundf_002d_002d_002dround-to-integer_002c-to-nearest"></span><h3 class="section">1.40 <code>lround</code>, <code>lroundf</code>, <code>llround</code>, <code>llroundf</code>—round to integer, to nearest</h3> |
| 1934 | <h3 class="section">1.39 <code>lround</code>, <code>lroundf</code>, <code>llround</code>, <code>llroundf</code>–round to integer, to nearest</h3> | 1937 | <span id="index-lround"></span> |
| 1935 | <a name="index-lround"></a> | 1938 | <span id="index-lroundf"></span> |
| 1936 | <a name="index-lroundf"></a> | 1939 | <span id="index-llround"></span> |
| 1937 | <a name="index-llround"></a> | 1940 | <span id="index-llroundf"></span> |
| 1938 | <a name="index-llroundf"></a> | ||
| 1939 | <p><strong>Synopsis</strong> | 1941 | <p><strong>Synopsis</strong> |
| 1940 | </p><div class="example"> | 1942 | </p><div class="example"> |
| 1941 | <pre class="example">#include <math.h> | 1943 | <pre class="example">#include <math.h> |
| @@ -1969,126 +1971,15 @@ ANSI C, POSIX | |||
| 1969 | 1971 | ||
| 1970 | <br> | 1972 | <br> |
| 1971 | <hr> | 1973 | <hr> |
| 1972 | <a name="matherr"></a> | ||
| 1973 | <div class="header"> | ||
| 1974 | <p> | ||
| 1975 | Next: <a href="#modf" accesskey="n" rel="next">modf</a>, Previous: <a href="#lround" accesskey="p" rel="previous">lround</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 1976 | </div> | 1974 | </div> |
| 1977 | <a name="matherr_002d_002d_002dmodifiable-math-error-handler"></a> | 1975 | <div class="section" id="modf"> |
| 1978 | <h3 class="section">1.40 <code>matherr</code>—modifiable math error handler</h3> | ||
| 1979 | <a name="index-matherr"></a> | ||
| 1980 | <p><strong>Synopsis</strong> | ||
| 1981 | </p><div class="example"> | ||
| 1982 | <pre class="example">#include <math.h> | ||
| 1983 | int matherr(struct exception *<var>e</var>); | ||
| 1984 | |||
| 1985 | </pre></div> | ||
| 1986 | <p><strong>Description</strong><br> | ||
| 1987 | <code>matherr</code> is called whenever a math library function generates an error. | ||
| 1988 | You can replace <code>matherr</code> by your own subroutine to customize | ||
| 1989 | error treatment. The customized <code>matherr</code> must return 0 if | ||
| 1990 | it fails to resolve the error, and non-zero if the error is resolved. | ||
| 1991 | </p> | ||
| 1992 | <p>When <code>matherr</code> returns a nonzero value, no error message is printed | ||
| 1993 | and the value of <code>errno</code> is not modified. You can accomplish either | ||
| 1994 | or both of these things in your own <code>matherr</code> using the information | ||
| 1995 | passed in the structure <code>*<var>e</var></code>. | ||
| 1996 | </p> | ||
| 1997 | <p>This is the <code>exception</code> structure (defined in ‘<code>math.h</code>’): | ||
| 1998 | </p><div class="smallexample"> | ||
| 1999 | <pre class="smallexample"> struct exception { | ||
| 2000 | int type; | ||
| 2001 | char *name; | ||
| 2002 | double arg1, arg2, retval; | ||
| 2003 | int err; | ||
| 2004 | }; | ||
| 2005 | </pre></div> | ||
| 2006 | |||
| 2007 | <p>The members of the exception structure have the following meanings: | ||
| 2008 | </p><dl compact="compact"> | ||
| 2009 | <dt><code>type</code></dt> | ||
| 2010 | <dd><p>The type of mathematical error that occured; macros encoding error | ||
| 2011 | types are also defined in ‘<code>math.h</code>’. | ||
| 2012 | </p> | ||
| 2013 | </dd> | ||
| 2014 | <dt><code>name</code></dt> | ||
| 2015 | <dd><p>a pointer to a null-terminated string holding the | ||
| 2016 | name of the math library function where the error occurred. | ||
| 2017 | </p> | ||
| 2018 | </dd> | ||
| 2019 | <dt><code>arg1, arg2</code></dt> | ||
| 2020 | <dd><p>The arguments which caused the error. | ||
| 2021 | </p> | ||
| 2022 | </dd> | ||
| 2023 | <dt><code>retval</code></dt> | ||
| 2024 | <dd><p>The error return value (what the calling function will return). | ||
| 2025 | </p> | ||
| 2026 | </dd> | ||
| 2027 | <dt><code>err</code></dt> | ||
| 2028 | <dd><p>If set to be non-zero, this is the new value assigned to <code>errno</code>. | ||
| 2029 | </p></dd> | ||
| 2030 | </dl> | ||
| 2031 | |||
| 2032 | |||
| 2033 | <p>The error types defined in ‘<code>math.h</code>’ represent possible mathematical | ||
| 2034 | errors as follows: | ||
| 2035 | </p> | ||
| 2036 | <dl compact="compact"> | ||
| 2037 | <dt><code>DOMAIN</code></dt> | ||
| 2038 | <dd><p>An argument was not in the domain of the function; e.g. <code>log(-1.0)</code>. | ||
| 2039 | </p> | ||
| 2040 | </dd> | ||
| 2041 | <dt><code>SING</code></dt> | ||
| 2042 | <dd><p>The requested calculation would result in a singularity; e.g. <code>pow(0.0,-2.0)</code> | ||
| 2043 | </p> | ||
| 2044 | </dd> | ||
| 2045 | <dt><code>OVERFLOW</code></dt> | ||
| 2046 | <dd><p>A calculation would produce a result too large to represent; e.g. | ||
| 2047 | <code>exp(1000.0)</code>. | ||
| 2048 | </p> | ||
| 2049 | </dd> | ||
| 2050 | <dt><code>UNDERFLOW</code></dt> | ||
| 2051 | <dd><p>A calculation would produce a result too small to represent; e.g. | ||
| 2052 | <code>exp(-1000.0)</code>. | ||
| 2053 | </p> | ||
| 2054 | </dd> | ||
| 2055 | <dt><code>TLOSS</code></dt> | ||
| 2056 | <dd><p>Total loss of precision. The result would have no significant digits; | ||
| 2057 | e.g. <code>sin(10e70)</code>. | ||
| 2058 | </p> | ||
| 2059 | </dd> | ||
| 2060 | <dt><code>PLOSS</code></dt> | ||
| 2061 | <dd><p>Partial loss of precision. | ||
| 2062 | </p></dd> | ||
| 2063 | </dl> | ||
| 2064 | |||
| 2065 | |||
| 2066 | <br> | ||
| 2067 | <p><strong>Returns</strong><br> | ||
| 2068 | The library definition for <code>matherr</code> returns <code>0</code> in all cases. | ||
| 2069 | </p> | ||
| 2070 | <p>You can change the calling function’s result from a customized <code>matherr</code> | ||
| 2071 | by modifying <code>e->retval</code>, which propagates backs to the caller. | ||
| 2072 | </p> | ||
| 2073 | <p>If <code>matherr</code> returns <code>0</code> (indicating that it was not able to resolve | ||
| 2074 | the error) the caller sets <code>errno</code> to an appropriate value, and prints | ||
| 2075 | an error message. | ||
| 2076 | </p> | ||
| 2077 | <br> | ||
| 2078 | <p><strong>Portability</strong><br> | ||
| 2079 | <code>matherr</code> is not ANSI C. | ||
| 2080 | </p> | ||
| 2081 | <br> | ||
| 2082 | <hr> | ||
| 2083 | <a name="modf"></a> | ||
| 2084 | <div class="header"> | 1976 | <div class="header"> |
| 2085 | <p> | 1977 | <p> |
| 2086 | Next: <a href="#nan" accesskey="n" rel="next">nan</a>, Previous: <a href="#matherr" accesskey="p" rel="previous">matherr</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 1978 | Next: <a href="#nan" accesskey="n" rel="next"><code>nan</code>, <code>nanf</code>—representation of “Not a Number”</a>, Previous: <a href="#lround" accesskey="p" rel="prev"><code>lround</code>, <code>lroundf</code>, <code>llround</code>, <code>llroundf</code>—round to integer, to nearest</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2087 | </div> | 1979 | </div> |
| 2088 | <a name="modf_002c-modff_002d_002d_002dsplit-fractional-and-integer-parts"></a> | 1980 | <span id="modf_002c-modff_002d_002d_002dsplit-fractional-and-integer-parts"></span><h3 class="section">1.41 <code>modf</code>, <code>modff</code>—split fractional and integer parts</h3> |
| 2089 | <h3 class="section">1.41 <code>modf</code>, <code>modff</code>—split fractional and integer parts</h3> | 1981 | <span id="index-modf"></span> |
| 2090 | <a name="index-modf"></a> | 1982 | <span id="index-modff"></span> |
| 2091 | <a name="index-modff"></a> | ||
| 2092 | <p><strong>Synopsis</strong> | 1983 | <p><strong>Synopsis</strong> |
| 2093 | </p><div class="example"> | 1984 | </p><div class="example"> |
| 2094 | <pre class="example">#include <math.h> | 1985 | <pre class="example">#include <math.h> |
| @@ -2118,20 +2009,20 @@ sign as the supplied argument <var>val</var>. | |||
| 2118 | </p> | 2009 | </p> |
| 2119 | <br> | 2010 | <br> |
| 2120 | <hr> | 2011 | <hr> |
| 2121 | <a name="nan"></a> | 2012 | </div> |
| 2013 | <div class="section" id="nan"> | ||
| 2122 | <div class="header"> | 2014 | <div class="header"> |
| 2123 | <p> | 2015 | <p> |
| 2124 | Next: <a href="#nearbyint" accesskey="n" rel="next">nearbyint</a>, Previous: <a href="#modf" accesskey="p" rel="previous">modf</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2016 | Next: <a href="#nearbyint" accesskey="n" rel="next"><code>nearbyint</code>, <code>nearbyintf</code>—round to integer</a>, Previous: <a href="#modf" accesskey="p" rel="prev"><code>modf</code>, <code>modff</code>—split fractional and integer parts</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2125 | </div> | 2017 | </div> |
| 2126 | <a name="nan_002c-nanf_002d_002d_002drepresentation-of-_0060_0060Not-a-Number_0027_0027"></a> | 2018 | <span id="nan_002c-nanf_002d_002d_002drepresentation-of-_0060_0060Not-a-Number_0027_0027"></span><h3 class="section">1.42 <code>nan</code>, <code>nanf</code>—representation of “Not a Number”</h3> |
| 2127 | <h3 class="section">1.42 <code>nan</code>, <code>nanf</code>—representation of “Not a Number”</h3> | 2019 | <span id="index-nan"></span> |
| 2128 | <a name="index-nan"></a> | 2020 | <span id="index-nanf"></span> |
| 2129 | <a name="index-nanf"></a> | ||
| 2130 | <p><strong>Synopsis</strong> | 2021 | <p><strong>Synopsis</strong> |
| 2131 | </p><div class="example"> | 2022 | </p><div class="example"> |
| 2132 | <pre class="example">#include <math.h> | 2023 | <pre class="example">#include <math.h> |
| 2133 | double nan(const char *); | 2024 | double nan(const char *<var>unused</var>); |
| 2134 | float nanf(const char *); | 2025 | float nanf(const char *<var>unused</var>); |
| 2135 | 2026 | ||
| 2136 | </pre></div> | 2027 | </pre></div> |
| 2137 | <p><strong>Description</strong><br> | 2028 | <p><strong>Description</strong><br> |
| @@ -2141,15 +2032,15 @@ argument is currently disregarded. | |||
| 2141 | </p> | 2032 | </p> |
| 2142 | <br> | 2033 | <br> |
| 2143 | <hr> | 2034 | <hr> |
| 2144 | <a name="nearbyint"></a> | 2035 | </div> |
| 2036 | <div class="section" id="nearbyint"> | ||
| 2145 | <div class="header"> | 2037 | <div class="header"> |
| 2146 | <p> | 2038 | <p> |
| 2147 | Next: <a href="#nextafter" accesskey="n" rel="next">nextafter</a>, Previous: <a href="#nan" accesskey="p" rel="previous">nan</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2039 | Next: <a href="#nextafter" accesskey="n" rel="next"><code>nextafter</code>, <code>nextafterf</code>—get next number</a>, Previous: <a href="#nan" accesskey="p" rel="prev"><code>nan</code>, <code>nanf</code>—representation of “Not a Number”</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2148 | </div> | 2040 | </div> |
| 2149 | <a name="nearbyint_002c-nearbyintf_002d_002dround-to-integer"></a> | 2041 | <span id="nearbyint_002c-nearbyintf_002d_002d_002dround-to-integer"></span><h3 class="section">1.43 <code>nearbyint</code>, <code>nearbyintf</code>—round to integer</h3> |
| 2150 | <h3 class="section">1.43 <code>nearbyint</code>, <code>nearbyintf</code>–round to integer</h3> | 2042 | <span id="index-nearbyint"></span> |
| 2151 | <a name="index-nearbyint"></a> | 2043 | <span id="index-nearbyintf"></span> |
| 2152 | <a name="index-nearbyintf"></a> | ||
| 2153 | <p><strong>Synopsis</strong> | 2044 | <p><strong>Synopsis</strong> |
| 2154 | </p><div class="example"> | 2045 | </p><div class="example"> |
| 2155 | <pre class="example">#include <math.h> | 2046 | <pre class="example">#include <math.h> |
| @@ -2187,15 +2078,15 @@ ANSI C, POSIX | |||
| 2187 | </p> | 2078 | </p> |
| 2188 | <br> | 2079 | <br> |
| 2189 | <hr> | 2080 | <hr> |
| 2190 | <a name="nextafter"></a> | 2081 | </div> |
| 2082 | <div class="section" id="nextafter"> | ||
| 2191 | <div class="header"> | 2083 | <div class="header"> |
| 2192 | <p> | 2084 | <p> |
| 2193 | Next: <a href="#pow" accesskey="n" rel="next">pow</a>, Previous: <a href="#nearbyint" accesskey="p" rel="previous">nearbyint</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2085 | Next: <a href="#pow" accesskey="n" rel="next"><code>pow</code>, <code>powf</code>—x to the power y</a>, Previous: <a href="#nearbyint" accesskey="p" rel="prev"><code>nearbyint</code>, <code>nearbyintf</code>—round to integer</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2194 | </div> | 2086 | </div> |
| 2195 | <a name="nextafter_002c-nextafterf_002d_002d_002dget-next-number"></a> | 2087 | <span id="nextafter_002c-nextafterf_002d_002d_002dget-next-number"></span><h3 class="section">1.44 <code>nextafter</code>, <code>nextafterf</code>—get next number</h3> |
| 2196 | <h3 class="section">1.44 <code>nextafter</code>, <code>nextafterf</code>—get next number</h3> | 2088 | <span id="index-nextafter"></span> |
| 2197 | <a name="index-nextafter"></a> | 2089 | <span id="index-nextafterf"></span> |
| 2198 | <a name="index-nextafterf"></a> | ||
| 2199 | <p><strong>Synopsis</strong> | 2090 | <p><strong>Synopsis</strong> |
| 2200 | </p><div class="example"> | 2091 | </p><div class="example"> |
| 2201 | <pre class="example">#include <math.h> | 2092 | <pre class="example">#include <math.h> |
| @@ -2222,15 +2113,15 @@ or by the System V Interface Definition (Issue 2). | |||
| 2222 | </p> | 2113 | </p> |
| 2223 | <br> | 2114 | <br> |
| 2224 | <hr> | 2115 | <hr> |
| 2225 | <a name="pow"></a> | 2116 | </div> |
| 2117 | <div class="section" id="pow"> | ||
| 2226 | <div class="header"> | 2118 | <div class="header"> |
| 2227 | <p> | 2119 | <p> |
| 2228 | Next: <a href="#remainder" accesskey="n" rel="next">remainder</a>, Previous: <a href="#nextafter" accesskey="p" rel="previous">nextafter</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2120 | Next: <a href="#pow10" accesskey="n" rel="next"><code>pow10</code>, <code>pow10f</code>—base 10 power functions</a>, Previous: <a href="#nextafter" accesskey="p" rel="prev"><code>nextafter</code>, <code>nextafterf</code>—get next number</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2229 | </div> | 2121 | </div> |
| 2230 | <a name="pow_002c-powf_002d_002d_002dx-to-the-power-y"></a> | 2122 | <span id="pow_002c-powf_002d_002d_002dx-to-the-power-y"></span><h3 class="section">1.45 <code>pow</code>, <code>powf</code>—x to the power y</h3> |
| 2231 | <h3 class="section">1.45 <code>pow</code>, <code>powf</code>—x to the power y</h3> | 2123 | <span id="index-pow"></span> |
| 2232 | <a name="index-pow"></a> | 2124 | <span id="index-powf"></span> |
| 2233 | <a name="index-powf"></a> | ||
| 2234 | <p><strong>Synopsis</strong> | 2125 | <p><strong>Synopsis</strong> |
| 2235 | </p><div class="example"> | 2126 | </p><div class="example"> |
| 2236 | <pre class="example">#include <math.h> | 2127 | <pre class="example">#include <math.h> |
| @@ -2252,22 +2143,53 @@ noninteger, and <var>y</var> is also not an integer, then <code>errno</code> | |||
| 2252 | is set to <code>EDOM</code>. If <var>x</var> and <var>y</var> are both 0, then | 2143 | is set to <code>EDOM</code>. If <var>x</var> and <var>y</var> are both 0, then |
| 2253 | <code>pow</code> and <code>powf</code> return <code>1</code>. | 2144 | <code>pow</code> and <code>powf</code> return <code>1</code>. |
| 2254 | </p> | 2145 | </p> |
| 2255 | <p>You can modify error handling for these functions using <code>matherr</code>. | ||
| 2256 | </p> | ||
| 2257 | <br> | 2146 | <br> |
| 2258 | <p><strong>Portability</strong><br> | 2147 | <p><strong>Portability</strong><br> |
| 2259 | <code>pow</code> is ANSI C. <code>powf</code> is an extension. | 2148 | <code>pow</code> is ANSI C. <code>powf</code> is an extension. |
| 2149 | </p><br> | ||
| 2150 | <hr> | ||
| 2151 | </div> | ||
| 2152 | <div class="section" id="pow10"> | ||
| 2153 | <div class="header"> | ||
| 2154 | <p> | ||
| 2155 | Next: <a href="#remainder" accesskey="n" rel="next"><code>remainder</code>, <code>remainderf</code>—round and remainder</a>, Previous: <a href="#pow" accesskey="p" rel="prev"><code>pow</code>, <code>powf</code>—x to the power y</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 2156 | </div> | ||
| 2157 | <span id="pow10_002c-pow10f_002d_002d_002dbase-10-power-functions"></span><h3 class="section">1.46 <code>pow10</code>, <code>pow10f</code>—base 10 power functions</h3> | ||
| 2158 | <span id="index-pow10"></span> | ||
| 2159 | <span id="index-pow10f"></span> | ||
| 2160 | <p><strong>Synopsis</strong> | ||
| 2161 | </p><div class="example"> | ||
| 2162 | <pre class="example">#include <math.h> | ||
| 2163 | double pow10(double <var>x</var>); | ||
| 2164 | float pow10f(float <var>x</var>); | ||
| 2165 | |||
| 2166 | </pre></div> | ||
| 2167 | <p><strong>Description</strong><br> | ||
| 2168 | <code>pow10</code> and <code>pow10f</code> calculate 10 ^ <var>x</var>, that is, | ||
| 2169 | 10 raised to the power <var>x</var>. | ||
| 2170 | </p> | ||
| 2260 | <br> | 2171 | <br> |
| 2261 | </p><hr> | 2172 | <p><strong>Returns</strong><br> |
| 2262 | <a name="remainder"></a> | 2173 | On success, <code>pow10</code> and <code>pow10f</code> return the calculated value. |
| 2174 | If the result underflows, the returned value is <code>0</code>. If the | ||
| 2175 | result overflows, the returned value is <code>HUGE_VAL</code>. In | ||
| 2176 | either case, <code>errno</code> is set to <code>ERANGE</code>. | ||
| 2177 | </p> | ||
| 2178 | <br> | ||
| 2179 | <p><strong>Portability</strong><br> | ||
| 2180 | <code>pow10</code> and <code>pow10f</code> are GNU extensions. | ||
| 2181 | </p> | ||
| 2182 | <br> | ||
| 2183 | <hr> | ||
| 2184 | </div> | ||
| 2185 | <div class="section" id="remainder"> | ||
| 2263 | <div class="header"> | 2186 | <div class="header"> |
| 2264 | <p> | 2187 | <p> |
| 2265 | Next: <a href="#remquo" accesskey="n" rel="next">remquo</a>, Previous: <a href="#pow" accesskey="p" rel="previous">pow</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2188 | Next: <a href="#remquo" accesskey="n" rel="next"><code>remquo</code>, <code>remquof</code>—remainder and part of quotient</a>, Previous: <a href="#pow10" accesskey="p" rel="prev"><code>pow10</code>, <code>pow10f</code>—base 10 power functions</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2266 | </div> | 2189 | </div> |
| 2267 | <a name="remainder_002c-remainderf_002d_002d_002dround-and-remainder"></a> | 2190 | <span id="remainder_002c-remainderf_002d_002d_002dround-and-remainder"></span><h3 class="section">1.47 <code>remainder</code>, <code>remainderf</code>—round and remainder</h3> |
| 2268 | <h3 class="section">1.46 <code>remainder</code>, <code>remainderf</code>—round and remainder</h3> | 2191 | <span id="index-remainder"></span> |
| 2269 | <a name="index-remainder"></a> | 2192 | <span id="index-remainderf"></span> |
| 2270 | <a name="index-remainderf"></a> | ||
| 2271 | <p><strong>Synopsis</strong> | 2193 | <p><strong>Synopsis</strong> |
| 2272 | </p><div class="example"> | 2194 | </p><div class="example"> |
| 2273 | <pre class="example">#include <math.h> | 2195 | <pre class="example">#include <math.h> |
| @@ -2291,15 +2213,15 @@ float remainderf(float <var>x</var>, float <var>y</var>); | |||
| 2291 | 2213 | ||
| 2292 | <br> | 2214 | <br> |
| 2293 | <hr> | 2215 | <hr> |
| 2294 | <a name="remquo"></a> | 2216 | </div> |
| 2217 | <div class="section" id="remquo"> | ||
| 2295 | <div class="header"> | 2218 | <div class="header"> |
| 2296 | <p> | 2219 | <p> |
| 2297 | Next: <a href="#rint" accesskey="n" rel="next">rint</a>, Previous: <a href="#remainder" accesskey="p" rel="previous">remainder</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2220 | Next: <a href="#rint" accesskey="n" rel="next"><code>rint</code>, <code>rintf</code>—round to integer</a>, Previous: <a href="#remainder" accesskey="p" rel="prev"><code>remainder</code>, <code>remainderf</code>—round and remainder</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2298 | </div> | 2221 | </div> |
| 2299 | <a name="remquo_002c-remquof_002d_002dremainder-and-part-of-quotient"></a> | 2222 | <span id="remquo_002c-remquof_002d_002d_002dremainder-and-part-of-quotient"></span><h3 class="section">1.48 <code>remquo</code>, <code>remquof</code>—remainder and part of quotient</h3> |
| 2300 | <h3 class="section">1.47 <code>remquo</code>, <code>remquof</code>–remainder and part of quotient</h3> | 2223 | <span id="index-remquo"></span> |
| 2301 | <a name="index-remquo"></a> | 2224 | <span id="index-remquof"></span> |
| 2302 | <a name="index-remquof"></a> | ||
| 2303 | <p><strong>Synopsis</strong> | 2225 | <p><strong>Synopsis</strong> |
| 2304 | </p><div class="example"> | 2226 | </p><div class="example"> |
| 2305 | <pre class="example">#include <math.h> | 2227 | <pre class="example">#include <math.h> |
| @@ -2317,12 +2239,12 @@ quotient, not counting the sign.) This implementation uses n=31 if int is 32 | |||
| 2317 | bits or more, otherwise, n is 1 less than the width of int. | 2239 | bits or more, otherwise, n is 1 less than the width of int. |
| 2318 | </p> | 2240 | </p> |
| 2319 | <p>For example: | 2241 | <p>For example: |
| 2320 | </p><div class="smallexample"> | 2242 | </p><div class="example"> |
| 2321 | <pre class="smallexample"> remquo(-29.0, 3.0, &<var>quo</var>) | 2243 | <pre class="example"> remquo(-29.0, 3.0, &<var>quo</var>) |
| 2322 | </pre></div> | 2244 | </pre></div> |
| 2323 | <p>returns -1.0 and sets <var>quo</var>=10, and | 2245 | <p>returns -1.0 and sets <var>quo</var>=10, and |
| 2324 | </p><div class="smallexample"> | 2246 | </p><div class="example"> |
| 2325 | <pre class="smallexample"> remquo(-98307.0, 3.0, &<var>quo</var>) | 2247 | <pre class="example"> remquo(-98307.0, 3.0, &<var>quo</var>) |
| 2326 | </pre></div> | 2248 | </pre></div> |
| 2327 | <p>returns -0.0 and sets <var>quo</var>=-32769, although for 16-bit int, <var>quo</var>=-1. In | 2249 | <p>returns -0.0 and sets <var>quo</var>=-32769, although for 16-bit int, <var>quo</var>=-1. In |
| 2328 | the latter case, the actual quotient of -(32769=0x8001) is reduced to -1 | 2250 | the latter case, the actual quotient of -(32769=0x8001) is reduced to -1 |
| @@ -2348,15 +2270,15 @@ C99, POSIX. | |||
| 2348 | 2270 | ||
| 2349 | <br> | 2271 | <br> |
| 2350 | <hr> | 2272 | <hr> |
| 2351 | <a name="rint"></a> | 2273 | </div> |
| 2274 | <div class="section" id="rint"> | ||
| 2352 | <div class="header"> | 2275 | <div class="header"> |
| 2353 | <p> | 2276 | <p> |
| 2354 | Next: <a href="#round" accesskey="n" rel="next">round</a>, Previous: <a href="#remquo" accesskey="p" rel="previous">remquo</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2277 | Next: <a href="#round" accesskey="n" rel="next"><code>round</code>, <code>roundf</code>—round to integer, to nearest</a>, Previous: <a href="#remquo" accesskey="p" rel="prev"><code>remquo</code>, <code>remquof</code>—remainder and part of quotient</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2355 | </div> | 2278 | </div> |
| 2356 | <a name="rint_002c-rintf_002d_002dround-to-integer"></a> | 2279 | <span id="rint_002c-rintf_002d_002d_002dround-to-integer"></span><h3 class="section">1.49 <code>rint</code>, <code>rintf</code>—round to integer</h3> |
| 2357 | <h3 class="section">1.48 <code>rint</code>, <code>rintf</code>–round to integer</h3> | 2280 | <span id="index-rint"></span> |
| 2358 | <a name="index-rint"></a> | 2281 | <span id="index-rintf"></span> |
| 2359 | <a name="index-rintf"></a> | ||
| 2360 | <p><strong>Synopsis</strong> | 2282 | <p><strong>Synopsis</strong> |
| 2361 | </p><div class="example"> | 2283 | </p><div class="example"> |
| 2362 | <pre class="example">#include <math.h> | 2284 | <pre class="example">#include <math.h> |
| @@ -2390,15 +2312,15 @@ ANSI C, POSIX | |||
| 2390 | 2312 | ||
| 2391 | <br> | 2313 | <br> |
| 2392 | <hr> | 2314 | <hr> |
| 2393 | <a name="round"></a> | 2315 | </div> |
| 2316 | <div class="section" id="round"> | ||
| 2394 | <div class="header"> | 2317 | <div class="header"> |
| 2395 | <p> | 2318 | <p> |
| 2396 | Next: <a href="#scalbn" accesskey="n" rel="next">scalbn</a>, Previous: <a href="#rint" accesskey="p" rel="previous">rint</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2319 | Next: <a href="#scalbn" accesskey="n" rel="next"><code>scalbn</code>, <code>scalbnf</code>, <code>scalbln</code>, <code>scalblnf</code>—scale by power of FLT_RADIX (=2)</a>, Previous: <a href="#rint" accesskey="p" rel="prev"><code>rint</code>, <code>rintf</code>—round to integer</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2397 | </div> | 2320 | </div> |
| 2398 | <a name="round_002c-roundf_002d_002dround-to-integer_002c-to-nearest"></a> | 2321 | <span id="round_002c-roundf_002d_002d_002dround-to-integer_002c-to-nearest"></span><h3 class="section">1.50 <code>round</code>, <code>roundf</code>—round to integer, to nearest</h3> |
| 2399 | <h3 class="section">1.49 <code>round</code>, <code>roundf</code>–round to integer, to nearest</h3> | 2322 | <span id="index-round"></span> |
| 2400 | <a name="index-round"></a> | 2323 | <span id="index-roundf"></span> |
| 2401 | <a name="index-roundf"></a> | ||
| 2402 | <p><strong>Synopsis</strong> | 2324 | <p><strong>Synopsis</strong> |
| 2403 | </p><div class="example"> | 2325 | </p><div class="example"> |
| 2404 | <pre class="example">#include <math.h> | 2326 | <pre class="example">#include <math.h> |
| @@ -2430,17 +2352,17 @@ ANSI C, POSIX | |||
| 2430 | 2352 | ||
| 2431 | <br> | 2353 | <br> |
| 2432 | <hr> | 2354 | <hr> |
| 2433 | <a name="scalbn"></a> | 2355 | </div> |
| 2356 | <div class="section" id="scalbn"> | ||
| 2434 | <div class="header"> | 2357 | <div class="header"> |
| 2435 | <p> | 2358 | <p> |
| 2436 | Next: <a href="#signbit" accesskey="n" rel="next">signbit</a>, Previous: <a href="#round" accesskey="p" rel="previous">round</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2359 | Next: <a href="#signbit" accesskey="n" rel="next"><code>signbit</code>—Does floating-point number have negative sign?</a>, Previous: <a href="#round" accesskey="p" rel="prev"><code>round</code>, <code>roundf</code>—round to integer, to nearest</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2437 | </div> | 2360 | </div> |
| 2438 | <a name="scalbn_002c-scalbnf_002c-scalbln_002c-scalblnf_002d_002dscale-by-power-of-FLT_005fRADIX-_0028_003d2_0029"></a> | 2361 | <span id="scalbn_002c-scalbnf_002c-scalbln_002c-scalblnf_002d_002d_002dscale-by-power-of-FLT_005fRADIX-_0028_003d2_0029"></span><h3 class="section">1.51 <code>scalbn</code>, <code>scalbnf</code>, <code>scalbln</code>, <code>scalblnf</code>—scale by power of FLT_RADIX (=2)</h3> |
| 2439 | <h3 class="section">1.50 <code>scalbn</code>, <code>scalbnf</code>, <code>scalbln</code>, <code>scalblnf</code>–scale by power of FLT_RADIX (=2)</h3> | 2362 | <span id="index-scalbn"></span> |
| 2440 | <a name="index-scalbn"></a> | 2363 | <span id="index-scalbnf"></span> |
| 2441 | <a name="index-scalbnf"></a> | 2364 | <span id="index-scalbln"></span> |
| 2442 | <a name="index-scalbln"></a> | 2365 | <span id="index-scalblnf"></span> |
| 2443 | <a name="index-scalblnf"></a> | ||
| 2444 | <p><strong>Synopsis</strong> | 2366 | <p><strong>Synopsis</strong> |
| 2445 | </p><div class="example"> | 2367 | </p><div class="example"> |
| 2446 | <pre class="example">#include <math.h> | 2368 | <pre class="example">#include <math.h> |
| @@ -2473,14 +2395,14 @@ ANSI C, POSIX | |||
| 2473 | 2395 | ||
| 2474 | <br> | 2396 | <br> |
| 2475 | <hr> | 2397 | <hr> |
| 2476 | <a name="signbit"></a> | 2398 | </div> |
| 2399 | <div class="section" id="signbit"> | ||
| 2477 | <div class="header"> | 2400 | <div class="header"> |
| 2478 | <p> | 2401 | <p> |
| 2479 | Next: <a href="#sin" accesskey="n" rel="next">sin</a>, Previous: <a href="#scalbn" accesskey="p" rel="previous">scalbn</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2402 | Next: <a href="#sin" accesskey="n" rel="next"><code>sin</code>, <code>sinf</code>, <code>cos</code>, <code>cosf</code>—sine or cosine</a>, Previous: <a href="#scalbn" accesskey="p" rel="prev"><code>scalbn</code>, <code>scalbnf</code>, <code>scalbln</code>, <code>scalblnf</code>—scale by power of FLT_RADIX (=2)</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2480 | </div> | 2403 | </div> |
| 2481 | <a name="signbit_002d_002dDoes-floating_002dpoint-number-have-negative-sign_003f"></a> | 2404 | <span id="signbit_002d_002d_002dDoes-floating_002dpoint-number-have-negative-sign_003f"></span><h3 class="section">1.52 <code>signbit</code>—Does floating-point number have negative sign?</h3> |
| 2482 | <h3 class="section">1.51 <code>signbit</code>–Does floating-point number have negative sign?</h3> | 2405 | <span id="index-signbit"></span> |
| 2483 | <a name="index-signbit"></a> | ||
| 2484 | <p><strong>Synopsis</strong> | 2406 | <p><strong>Synopsis</strong> |
| 2485 | </p><div class="example"> | 2407 | </p><div class="example"> |
| 2486 | <pre class="example">#include <math.h> | 2408 | <pre class="example">#include <math.h> |
| @@ -2509,17 +2431,17 @@ C99, POSIX. | |||
| 2509 | 2431 | ||
| 2510 | <br> | 2432 | <br> |
| 2511 | <hr> | 2433 | <hr> |
| 2512 | <a name="sin"></a> | 2434 | </div> |
| 2435 | <div class="section" id="sin"> | ||
| 2513 | <div class="header"> | 2436 | <div class="header"> |
| 2514 | <p> | 2437 | <p> |
| 2515 | Next: <a href="#sinh" accesskey="n" rel="next">sinh</a>, Previous: <a href="#signbit" accesskey="p" rel="previous">signbit</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2438 | Next: <a href="#sinh" accesskey="n" rel="next"><code>sinh</code>, <code>sinhf</code>—hyperbolic sine</a>, Previous: <a href="#signbit" accesskey="p" rel="prev"><code>signbit</code>—Does floating-point number have negative sign?</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2516 | </div> | 2439 | </div> |
| 2517 | <a name="sin_002c-sinf_002c-cos_002c-cosf_002d_002d_002dsine-or-cosine"></a> | 2440 | <span id="sin_002c-sinf_002c-cos_002c-cosf_002d_002d_002dsine-or-cosine"></span><h3 class="section">1.53 <code>sin</code>, <code>sinf</code>, <code>cos</code>, <code>cosf</code>—sine or cosine</h3> |
| 2518 | <h3 class="section">1.52 <code>sin</code>, <code>sinf</code>, <code>cos</code>, <code>cosf</code>—sine or cosine</h3> | 2441 | <span id="index-sin"></span> |
| 2519 | <a name="index-sin"></a> | 2442 | <span id="index-sinf"></span> |
| 2520 | <a name="index-sinf"></a> | 2443 | <span id="index-cos"></span> |
| 2521 | <a name="index-cos"></a> | 2444 | <span id="index-cosf"></span> |
| 2522 | <a name="index-cosf"></a> | ||
| 2523 | <p><strong>Synopsis</strong> | 2445 | <p><strong>Synopsis</strong> |
| 2524 | </p><div class="example"> | 2446 | </p><div class="example"> |
| 2525 | <pre class="example">#include <math.h> | 2447 | <pre class="example">#include <math.h> |
| @@ -2547,15 +2469,15 @@ The sine or cosine of <var>x</var> is returned. | |||
| 2547 | </p> | 2469 | </p> |
| 2548 | <br> | 2470 | <br> |
| 2549 | <hr> | 2471 | <hr> |
| 2550 | <a name="sinh"></a> | 2472 | </div> |
| 2473 | <div class="section" id="sinh"> | ||
| 2551 | <div class="header"> | 2474 | <div class="header"> |
| 2552 | <p> | 2475 | <p> |
| 2553 | Next: <a href="#sqrt" accesskey="n" rel="next">sqrt</a>, Previous: <a href="#sin" accesskey="p" rel="previous">sin</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2476 | Next: <a href="#sqrt" accesskey="n" rel="next"><code>sqrt</code>, <code>sqrtf</code>—positive square root</a>, Previous: <a href="#sin" accesskey="p" rel="prev"><code>sin</code>, <code>sinf</code>, <code>cos</code>, <code>cosf</code>—sine or cosine</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2554 | </div> | 2477 | </div> |
| 2555 | <a name="sinh_002c-sinhf_002d_002d_002dhyperbolic-sine"></a> | 2478 | <span id="sinh_002c-sinhf_002d_002d_002dhyperbolic-sine"></span><h3 class="section">1.54 <code>sinh</code>, <code>sinhf</code>—hyperbolic sine</h3> |
| 2556 | <h3 class="section">1.53 <code>sinh</code>, <code>sinhf</code>—hyperbolic sine</h3> | 2479 | <span id="index-sinh"></span> |
| 2557 | <a name="index-sinh"></a> | 2480 | <span id="index-sinhf"></span> |
| 2558 | <a name="index-sinhf"></a> | ||
| 2559 | <p><strong>Synopsis</strong> | 2481 | <p><strong>Synopsis</strong> |
| 2560 | </p><div class="example"> | 2482 | </p><div class="example"> |
| 2561 | <pre class="example">#include <math.h> | 2483 | <pre class="example">#include <math.h> |
| @@ -2566,8 +2488,8 @@ float sinhf(float <var>x</var>); | |||
| 2566 | <p><strong>Description</strong><br> | 2488 | <p><strong>Description</strong><br> |
| 2567 | <code>sinh</code> computes the hyperbolic sine of the argument <var>x</var>. | 2489 | <code>sinh</code> computes the hyperbolic sine of the argument <var>x</var>. |
| 2568 | Angles are specified in radians. <code>sinh</code>(<var>x</var>) is defined as | 2490 | Angles are specified in radians. <code>sinh</code>(<var>x</var>) is defined as |
| 2569 | </p><div class="smallexample"> | 2491 | </p><div class="example"> |
| 2570 | <pre class="smallexample"> (exp(<var>x</var>) - exp(-<var>x</var>))/2 | 2492 | <pre class="example"> (exp(<var>x</var>) - exp(-<var>x</var>))/2 |
| 2571 | </pre></div> | 2493 | </pre></div> |
| 2572 | 2494 | ||
| 2573 | <p><code>sinhf</code> is identical, save that it takes and returns <code>float</code> values. | 2495 | <p><code>sinhf</code> is identical, save that it takes and returns <code>float</code> values. |
| @@ -2581,8 +2503,6 @@ overflow), <code>sinh</code> returns <code>HUGE_VAL</code> with the | |||
| 2581 | appropriate sign, and sets the global value <code>errno</code> to | 2503 | appropriate sign, and sets the global value <code>errno</code> to |
| 2582 | <code>ERANGE</code>. | 2504 | <code>ERANGE</code>. |
| 2583 | </p> | 2505 | </p> |
| 2584 | <p>You can modify error handling for these functions with <code>matherr</code>. | ||
| 2585 | </p> | ||
| 2586 | <br> | 2506 | <br> |
| 2587 | <p><strong>Portability</strong><br> | 2507 | <p><strong>Portability</strong><br> |
| 2588 | <code>sinh</code> is ANSI C. | 2508 | <code>sinh</code> is ANSI C. |
| @@ -2590,15 +2510,15 @@ appropriate sign, and sets the global value <code>errno</code> to | |||
| 2590 | </p> | 2510 | </p> |
| 2591 | <br> | 2511 | <br> |
| 2592 | <hr> | 2512 | <hr> |
| 2593 | <a name="sqrt"></a> | 2513 | </div> |
| 2514 | <div class="section" id="sqrt"> | ||
| 2594 | <div class="header"> | 2515 | <div class="header"> |
| 2595 | <p> | 2516 | <p> |
| 2596 | Next: <a href="#tan" accesskey="n" rel="next">tan</a>, Previous: <a href="#sinh" accesskey="p" rel="previous">sinh</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2517 | Next: <a href="#tan" accesskey="n" rel="next"><code>tan</code>, <code>tanf</code>—tangent</a>, Previous: <a href="#sinh" accesskey="p" rel="prev"><code>sinh</code>, <code>sinhf</code>—hyperbolic sine</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2597 | </div> | 2518 | </div> |
| 2598 | <a name="sqrt_002c-sqrtf_002d_002d_002dpositive-square-root"></a> | 2519 | <span id="sqrt_002c-sqrtf_002d_002d_002dpositive-square-root"></span><h3 class="section">1.55 <code>sqrt</code>, <code>sqrtf</code>—positive square root</h3> |
| 2599 | <h3 class="section">1.54 <code>sqrt</code>, <code>sqrtf</code>—positive square root</h3> | 2520 | <span id="index-sqrt"></span> |
| 2600 | <a name="index-sqrt"></a> | 2521 | <span id="index-sqrtf"></span> |
| 2601 | <a name="index-sqrtf"></a> | ||
| 2602 | <p><strong>Synopsis</strong> | 2522 | <p><strong>Synopsis</strong> |
| 2603 | </p><div class="example"> | 2523 | </p><div class="example"> |
| 2604 | <pre class="example">#include <math.h> | 2524 | <pre class="example">#include <math.h> |
| @@ -2608,8 +2528,6 @@ float sqrtf(float <var>x</var>); | |||
| 2608 | </pre></div> | 2528 | </pre></div> |
| 2609 | <p><strong>Description</strong><br> | 2529 | <p><strong>Description</strong><br> |
| 2610 | <code>sqrt</code> computes the positive square root of the argument. | 2530 | <code>sqrt</code> computes the positive square root of the argument. |
| 2611 | You can modify error handling for this function with | ||
| 2612 | <code>matherr</code>. | ||
| 2613 | </p> | 2531 | </p> |
| 2614 | <br> | 2532 | <br> |
| 2615 | <p><strong>Returns</strong><br> | 2533 | <p><strong>Returns</strong><br> |
| @@ -2623,15 +2541,15 @@ negative, the global value <code>errno</code> is set to <code>EDOM</code> (domai | |||
| 2623 | </p> | 2541 | </p> |
| 2624 | <br> | 2542 | <br> |
| 2625 | <hr> | 2543 | <hr> |
| 2626 | <a name="tan"></a> | 2544 | </div> |
| 2545 | <div class="section" id="tan"> | ||
| 2627 | <div class="header"> | 2546 | <div class="header"> |
| 2628 | <p> | 2547 | <p> |
| 2629 | Next: <a href="#tanh" accesskey="n" rel="next">tanh</a>, Previous: <a href="#sqrt" accesskey="p" rel="previous">sqrt</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2548 | Next: <a href="#tanh" accesskey="n" rel="next"><code>tanh</code>, <code>tanhf</code>—hyperbolic tangent</a>, Previous: <a href="#sqrt" accesskey="p" rel="prev"><code>sqrt</code>, <code>sqrtf</code>—positive square root</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2630 | </div> | 2549 | </div> |
| 2631 | <a name="tan_002c-tanf_002d_002d_002dtangent"></a> | 2550 | <span id="tan_002c-tanf_002d_002d_002dtangent"></span><h3 class="section">1.56 <code>tan</code>, <code>tanf</code>—tangent</h3> |
| 2632 | <h3 class="section">1.55 <code>tan</code>, <code>tanf</code>—tangent</h3> | 2551 | <span id="index-tan"></span> |
| 2633 | <a name="index-tan"></a> | 2552 | <span id="index-tanf"></span> |
| 2634 | <a name="index-tanf"></a> | ||
| 2635 | <p><strong>Synopsis</strong> | 2553 | <p><strong>Synopsis</strong> |
| 2636 | </p><div class="example"> | 2554 | </p><div class="example"> |
| 2637 | <pre class="example">#include <math.h> | 2555 | <pre class="example">#include <math.h> |
| @@ -2655,15 +2573,15 @@ The tangent of <var>x</var> is returned. | |||
| 2655 | </p> | 2573 | </p> |
| 2656 | <br> | 2574 | <br> |
| 2657 | <hr> | 2575 | <hr> |
| 2658 | <a name="tanh"></a> | 2576 | </div> |
| 2577 | <div class="section" id="tanh"> | ||
| 2659 | <div class="header"> | 2578 | <div class="header"> |
| 2660 | <p> | 2579 | <p> |
| 2661 | Next: <a href="#trunc" accesskey="n" rel="next">trunc</a>, Previous: <a href="#tan" accesskey="p" rel="previous">tan</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2580 | Next: <a href="#trunc" accesskey="n" rel="next"><code>trunc</code>, <code>truncf</code>—round to integer, towards zero</a>, Previous: <a href="#tan" accesskey="p" rel="prev"><code>tan</code>, <code>tanf</code>—tangent</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2662 | </div> | 2581 | </div> |
| 2663 | <a name="tanh_002c-tanhf_002d_002d_002dhyperbolic-tangent"></a> | 2582 | <span id="tanh_002c-tanhf_002d_002d_002dhyperbolic-tangent"></span><h3 class="section">1.57 <code>tanh</code>, <code>tanhf</code>—hyperbolic tangent</h3> |
| 2664 | <h3 class="section">1.56 <code>tanh</code>, <code>tanhf</code>—hyperbolic tangent</h3> | 2583 | <span id="index-tanh"></span> |
| 2665 | <a name="index-tanh"></a> | 2584 | <span id="index-tanhf"></span> |
| 2666 | <a name="index-tanhf"></a> | ||
| 2667 | <p><strong>Synopsis</strong> | 2585 | <p><strong>Synopsis</strong> |
| 2668 | </p><div class="example"> | 2586 | </p><div class="example"> |
| 2669 | <pre class="example">#include <math.h> | 2587 | <pre class="example">#include <math.h> |
| @@ -2677,8 +2595,8 @@ float tanhf(float <var>x</var>); | |||
| 2677 | the argument <var>x</var>. Angles are specified in radians. | 2595 | the argument <var>x</var>. Angles are specified in radians. |
| 2678 | </p> | 2596 | </p> |
| 2679 | <p><code>tanh(<var>x</var>)</code> is defined as | 2597 | <p><code>tanh(<var>x</var>)</code> is defined as |
| 2680 | </p><div class="smallexample"> | 2598 | </p><div class="example"> |
| 2681 | <pre class="smallexample"> sinh(<var>x</var>)/cosh(<var>x</var>) | 2599 | <pre class="example"> sinh(<var>x</var>)/cosh(<var>x</var>) |
| 2682 | </pre></div> | 2600 | </pre></div> |
| 2683 | <p><code>tanhf</code> is identical, save that it takes and returns <code>float</code> values. | 2601 | <p><code>tanhf</code> is identical, save that it takes and returns <code>float</code> values. |
| 2684 | </p> | 2602 | </p> |
| @@ -2693,15 +2611,15 @@ The hyperbolic tangent of <var>x</var> is returned. | |||
| 2693 | 2611 | ||
| 2694 | <br> | 2612 | <br> |
| 2695 | <hr> | 2613 | <hr> |
| 2696 | <a name="trunc"></a> | 2614 | </div> |
| 2615 | <div class="section" id="trunc"> | ||
| 2697 | <div class="header"> | 2616 | <div class="header"> |
| 2698 | <p> | 2617 | <p> |
| 2699 | Previous: <a href="#tanh" accesskey="p" rel="previous">tanh</a>, Up: <a href="#Math" accesskey="u" rel="up">Math</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2618 | Previous: <a href="#tanh" accesskey="p" rel="prev"><code>tanh</code>, <code>tanhf</code>—hyperbolic tangent</a>, Up: <a href="#Math" accesskey="u" rel="up">Mathematical Functions (<samp>math.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2700 | </div> | 2619 | </div> |
| 2701 | <a name="trunc_002c-truncf_002d_002dround-to-integer_002c-towards-zero"></a> | 2620 | <span id="trunc_002c-truncf_002d_002d_002dround-to-integer_002c-towards-zero"></span><h3 class="section">1.58 <code>trunc</code>, <code>truncf</code>—round to integer, towards zero</h3> |
| 2702 | <h3 class="section">1.57 <code>trunc</code>, <code>truncf</code>–round to integer, towards zero</h3> | 2621 | <span id="index-trunc"></span> |
| 2703 | <a name="index-trunc"></a> | 2622 | <span id="index-truncf"></span> |
| 2704 | <a name="index-truncf"></a> | ||
| 2705 | <p><strong>Synopsis</strong> | 2623 | <p><strong>Synopsis</strong> |
| 2706 | </p><div class="example"> | 2624 | </p><div class="example"> |
| 2707 | <pre class="example">#include <math.h> | 2625 | <pre class="example">#include <math.h> |
| @@ -2729,80 +2647,61 @@ ANSI C, POSIX | |||
| 2729 | 2647 | ||
| 2730 | <br> | 2648 | <br> |
| 2731 | <hr> | 2649 | <hr> |
| 2732 | <a name="Complex"></a> | 2650 | </div> |
| 2651 | </div> | ||
| 2652 | <div class="chapter" id="Complex"> | ||
| 2733 | <div class="header"> | 2653 | <div class="header"> |
| 2734 | <p> | 2654 | <p> |
| 2735 | Next: <a href="#Reentrancy" accesskey="n" rel="next">Reentrancy</a>, Previous: <a href="#Math" accesskey="p" rel="previous">Math</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2655 | Next: <a href="#Fenv" accesskey="n" rel="next">Floating-Point Environment (<samp>fenv.h</samp>)</a>, Previous: <a href="#Math" accesskey="p" rel="prev">Mathematical Functions (<samp>math.h</samp>)</a>, Up: <a href="#Top" accesskey="u" rel="up">LIBM</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2736 | </div> | 2656 | </div> |
| 2737 | <a name="Mathematical-Complex-Functions-_0028complex_002eh_0029"></a> | 2657 | <span id="Mathematical-Complex-Functions-_0028complex_002eh_0029"></span><h2 class="chapter">2 Mathematical Complex Functions (<samp>complex.h</samp>)</h2> |
| 2738 | <h2 class="chapter">2 Mathematical Complex Functions (<samp>complex.h</samp>)</h2> | ||
| 2739 | 2658 | ||
| 2740 | <p>This chapter groups the complex mathematical functions. The | 2659 | <p>This chapter groups the complex mathematical functions. The |
| 2741 | corresponding definitions and declarations are in <samp>complex.h</samp>. | 2660 | corresponding definitions and declarations are in <samp>complex.h</samp>. |
| 2742 | Functions and documentations are taken from NetBSD. | 2661 | Functions and documentations are taken from NetBSD. |
| 2743 | </p> | 2662 | </p> |
| 2744 | <table class="menu" border="0" cellspacing="0"> | ||
| 2745 | <tr><td align="left" valign="top">• <a href="#cabs" accesskey="1">cabs</a>:</td><td> </td><td align="left" valign="top">Complex absolute value | ||
| 2746 | </td></tr> | ||
| 2747 | <tr><td align="left" valign="top">• <a href="#cacos" accesskey="2">cacos</a>:</td><td> </td><td align="left" valign="top">Complex arc cosine | ||
| 2748 | </td></tr> | ||
| 2749 | <tr><td align="left" valign="top">• <a href="#cacosh" accesskey="3">cacosh</a>:</td><td> </td><td align="left" valign="top">Complex arc hyperbolic cosine | ||
| 2750 | </td></tr> | ||
| 2751 | <tr><td align="left" valign="top">• <a href="#carg" accesskey="4">carg</a>:</td><td> </td><td align="left" valign="top">Argument (also called phase angle) | ||
| 2752 | </td></tr> | ||
| 2753 | <tr><td align="left" valign="top">• <a href="#casin" accesskey="5">casin</a>:</td><td> </td><td align="left" valign="top">Complex arc sine | ||
| 2754 | </td></tr> | ||
| 2755 | <tr><td align="left" valign="top">• <a href="#casinh" accesskey="6">casinh</a>:</td><td> </td><td align="left" valign="top">Complex arc hyperbolic sine | ||
| 2756 | </td></tr> | ||
| 2757 | <tr><td align="left" valign="top">• <a href="#catan" accesskey="7">catan</a>:</td><td> </td><td align="left" valign="top">Complex arc tangent | ||
| 2758 | </td></tr> | ||
| 2759 | <tr><td align="left" valign="top">• <a href="#catanh" accesskey="8">catanh</a>:</td><td> </td><td align="left" valign="top">Complex arc hyperbolic tangent | ||
| 2760 | </td></tr> | ||
| 2761 | <tr><td align="left" valign="top">• <a href="#ccos" accesskey="9">ccos</a>:</td><td> </td><td align="left" valign="top">Complex cosine | ||
| 2762 | </td></tr> | ||
| 2763 | <tr><td align="left" valign="top">• <a href="#ccosh">ccosh</a>:</td><td> </td><td align="left" valign="top">Complex hyperbolic cosine | ||
| 2764 | </td></tr> | ||
| 2765 | <tr><td align="left" valign="top">• <a href="#cexp">cexp</a>:</td><td> </td><td align="left" valign="top">Complex exponent | ||
| 2766 | </td></tr> | ||
| 2767 | <tr><td align="left" valign="top">• <a href="#cimag">cimag</a>:</td><td> </td><td align="left" valign="top">Imaginary part | ||
| 2768 | </td></tr> | ||
| 2769 | <tr><td align="left" valign="top">• <a href="#clog">clog</a>:</td><td> </td><td align="left" valign="top">Complex natural (base e) logarithm | ||
| 2770 | </td></tr> | ||
| 2771 | <tr><td align="left" valign="top">• <a href="#conj">conj</a>:</td><td> </td><td align="left" valign="top">Complex conjugate | ||
| 2772 | </td></tr> | ||
| 2773 | <tr><td align="left" valign="top">• <a href="#cpow">cpow</a>:</td><td> </td><td align="left" valign="top">Complex power function | ||
| 2774 | </td></tr> | ||
| 2775 | <tr><td align="left" valign="top">• <a href="#cproj">cproj</a>:</td><td> </td><td align="left" valign="top">Compute a projection on the Riemann sphere | ||
| 2776 | </td></tr> | ||
| 2777 | <tr><td align="left" valign="top">• <a href="#creal">creal</a>:</td><td> </td><td align="left" valign="top">Real part | ||
| 2778 | </td></tr> | ||
| 2779 | <tr><td align="left" valign="top">• <a href="#csin">csin</a>:</td><td> </td><td align="left" valign="top">Complex sine | ||
| 2780 | </td></tr> | ||
| 2781 | <tr><td align="left" valign="top">• <a href="#csinh">csinh</a>:</td><td> </td><td align="left" valign="top">Complex hyperbolic sine | ||
| 2782 | </td></tr> | ||
| 2783 | <tr><td align="left" valign="top">• <a href="#csqrt">csqrt</a>:</td><td> </td><td align="left" valign="top">Complex square root | ||
| 2784 | </td></tr> | ||
| 2785 | <tr><td align="left" valign="top">• <a href="#ctan">ctan</a>:</td><td> </td><td align="left" valign="top">Complex tangent | ||
| 2786 | </td></tr> | ||
| 2787 | <tr><td align="left" valign="top">• <a href="#ctanh">ctanh</a>:</td><td> </td><td align="left" valign="top">Complex hyperbolic tangent | ||
| 2788 | </td></tr> | ||
| 2789 | </table> | ||
| 2790 | 2663 | ||
| 2664 | <ul class="section-toc"> | ||
| 2665 | <li><a href="#cabs" accesskey="1"><code>cabs</code>, <code>cabsf</code>, <code>cabsl</code>—complex absolute-value</a></li> | ||
| 2666 | <li><a href="#cacos" accesskey="2"><code>cacos</code>, <code>cacosf</code>—complex arc cosine</a></li> | ||
| 2667 | <li><a href="#cacosh" accesskey="3"><code>cacosh</code>, <code>cacoshf</code>—complex arc hyperbolic cosine</a></li> | ||
| 2668 | <li><a href="#carg" accesskey="4"><code>carg</code>, <code>cargf</code>—argument (phase angle)</a></li> | ||
| 2669 | <li><a href="#casin" accesskey="5"><code>casin</code>, <code>casinf</code>—complex arc sine</a></li> | ||
| 2670 | <li><a href="#casinh" accesskey="6"><code>casinh</code>, <code>casinhf</code>—complex arc hyperbolic sine</a></li> | ||
| 2671 | <li><a href="#catan" accesskey="7"><code>catan</code>, <code>catanf</code>—complex arc tangent</a></li> | ||
| 2672 | <li><a href="#catanh" accesskey="8"><code>catanh</code>, <code>catanhf</code>—complex arc hyperbolic tangent</a></li> | ||
| 2673 | <li><a href="#ccos" accesskey="9"><code>ccos</code>, <code>ccosf</code>—complex cosine</a></li> | ||
| 2674 | <li><a href="#ccosh"><code>ccosh</code>, <code>ccoshf</code>—complex hyperbolic cosine</a></li> | ||
| 2675 | <li><a href="#cexp"><code>cexp</code>, <code>cexpf</code>—complex base-e exponential</a></li> | ||
| 2676 | <li><a href="#cimag"><code>cimag</code>, <code>cimagf</code>, <code>cimagl</code>—imaginary part</a></li> | ||
| 2677 | <li><a href="#clog"><code>clog</code>, <code>clogf</code>—complex base-e logarithm</a></li> | ||
| 2678 | <li><a href="#clog10"><code>clog10</code>, <code>clog10f</code>—complex base-10 logarithm</a></li> | ||
| 2679 | <li><a href="#conj"><code>conj</code>, <code>conjf</code>—complex conjugate</a></li> | ||
| 2680 | <li><a href="#cpow"><code>cpow</code>, <code>cpowf</code>—complex power</a></li> | ||
| 2681 | <li><a href="#cproj"><code>cproj</code>, <code>cprojf</code>— Riemann sphere projection</a></li> | ||
| 2682 | <li><a href="#creal"><code>creal</code>, <code>crealf</code>, <code>creall</code>—real part</a></li> | ||
| 2683 | <li><a href="#csin"><code>csin</code>, <code>csinf</code>—complex sine</a></li> | ||
| 2684 | <li><a href="#csinh"><code>csinh</code>, <code>csinhf</code>—complex hyperbolic sine</a></li> | ||
| 2685 | <li><a href="#csqrt"><code>csqrt</code>, <code>csqrtf</code>—complex square root</a></li> | ||
| 2686 | <li><a href="#ctan"><code>ctan</code>, <code>ctanf</code>—complex tangent</a></li> | ||
| 2687 | <li><a href="#ctanh"><code>ctanh</code>, <code>ctanf</code>—complex hyperbolic tangent</a></li> | ||
| 2688 | </ul> | ||
| 2791 | <hr> | 2689 | <hr> |
| 2792 | <a name="cabs"></a> | 2690 | <div class="section" id="cabs"> |
| 2793 | <div class="header"> | 2691 | <div class="header"> |
| 2794 | <p> | 2692 | <p> |
| 2795 | Next: <a href="#cacos" accesskey="n" rel="next">cacos</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2693 | Next: <a href="#cacos" accesskey="n" rel="next"><code>cacos</code>, <code>cacosf</code>—complex arc cosine</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2796 | </div> | 2694 | </div> |
| 2797 | <a name="cabs_002c-cabsf_002d_002d_002dcomplex-absolute_002dvalue"></a> | 2695 | <span id="cabs_002c-cabsf_002c-cabsl_002d_002d_002dcomplex-absolute_002dvalue"></span><h3 class="section">2.1 <code>cabs</code>, <code>cabsf</code>, <code>cabsl</code>—complex absolute-value</h3> |
| 2798 | <h3 class="section">2.1 <code>cabs</code>, <code>cabsf</code>—complex absolute-value</h3> | 2696 | <span id="index-cabs"></span> |
| 2799 | <a name="index-cabs"></a> | 2697 | <span id="index-cabsf"></span> |
| 2800 | <a name="index-cabsf"></a> | 2698 | <span id="index-cabsl"></span> |
| 2801 | <p><strong>Synopsis</strong> | 2699 | <p><strong>Synopsis</strong> |
| 2802 | </p><div class="example"> | 2700 | </p><div class="example"> |
| 2803 | <pre class="example">#include <complex.h> | 2701 | <pre class="example">#include <complex.h> |
| 2804 | double cabs(double complex <var>z</var>); | 2702 | double cabs(double complex <var>z</var>); |
| 2805 | float cabsf(float complex <var>z</var>); | 2703 | float cabsf(float complex <var>z</var>); |
| 2704 | long double cabsl(long double complex <var>z</var>); | ||
| 2806 | 2705 | ||
| 2807 | </pre></div> | 2706 | </pre></div> |
| 2808 | <p><strong>Description</strong><br> | 2707 | <p><strong>Description</strong><br> |
| @@ -2810,27 +2709,30 @@ These functions compute compute the complex absolute value | |||
| 2810 | (also called norm, modulus, or magnitude) of <var>z</var>. | 2709 | (also called norm, modulus, or magnitude) of <var>z</var>. |
| 2811 | </p> | 2710 | </p> |
| 2812 | <p><code>cabsf</code> is identical to <code>cabs</code>, except that it performs | 2711 | <p><code>cabsf</code> is identical to <code>cabs</code>, except that it performs |
| 2813 | its calculations on <code>floats complex</code>. | 2712 | its calculations on <code>float complex</code>. |
| 2713 | </p> | ||
| 2714 | <p><code>cabsl</code> is identical to <code>cabs</code>, except that it performs | ||
| 2715 | its calculations on <code>long double complex</code>. | ||
| 2814 | </p> | 2716 | </p> |
| 2815 | <br> | 2717 | <br> |
| 2816 | <p><strong>Returns</strong><br> | 2718 | <p><strong>Returns</strong><br> |
| 2817 | The cabs functions return the complex absolute value. | 2719 | The cabs* functions return the complex absolute value. |
| 2818 | </p> | 2720 | </p> |
| 2819 | <br> | 2721 | <br> |
| 2820 | <p><strong>Portability</strong><br> | 2722 | <p><strong>Portability</strong><br> |
| 2821 | <code>cabs</code> and <code>cabsf</code> are ISO C99 | 2723 | <code>cabs</code>, <code>cabsf</code> and <code>cabsl</code> are ISO C99 |
| 2822 | </p> | 2724 | </p> |
| 2823 | <br> | 2725 | <br> |
| 2824 | <hr> | 2726 | <hr> |
| 2825 | <a name="cacos"></a> | 2727 | </div> |
| 2728 | <div class="section" id="cacos"> | ||
| 2826 | <div class="header"> | 2729 | <div class="header"> |
| 2827 | <p> | 2730 | <p> |
| 2828 | Next: <a href="#cacosh" accesskey="n" rel="next">cacosh</a>, Previous: <a href="#cabs" accesskey="p" rel="previous">cabs</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2731 | Next: <a href="#cacosh" accesskey="n" rel="next"><code>cacosh</code>, <code>cacoshf</code>—complex arc hyperbolic cosine</a>, Previous: <a href="#cabs" accesskey="p" rel="prev"><code>cabs</code>, <code>cabsf</code>, <code>cabsl</code>—complex absolute-value</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2829 | </div> | 2732 | </div> |
| 2830 | <a name="cacos_002c-cacosf_002d_002d_002dcomplex-arc-cosine"></a> | 2733 | <span id="cacos_002c-cacosf_002d_002d_002dcomplex-arc-cosine"></span><h3 class="section">2.2 <code>cacos</code>, <code>cacosf</code>—complex arc cosine</h3> |
| 2831 | <h3 class="section">2.2 <code>cacos</code>, <code>cacosf</code>—complex arc cosine</h3> | 2734 | <span id="index-cacos"></span> |
| 2832 | <a name="index-cacos"></a> | 2735 | <span id="index-cacosf"></span> |
| 2833 | <a name="index-cacosf"></a> | ||
| 2834 | <p><strong>Synopsis</strong> | 2736 | <p><strong>Synopsis</strong> |
| 2835 | </p><div class="example"> | 2737 | </p><div class="example"> |
| 2836 | <pre class="example">#include <complex.h> | 2738 | <pre class="example">#include <complex.h> |
| @@ -2857,15 +2759,15 @@ and in the interval [0, pi] along the real axis. | |||
| 2857 | </p> | 2759 | </p> |
| 2858 | <br> | 2760 | <br> |
| 2859 | <hr> | 2761 | <hr> |
| 2860 | <a name="cacosh"></a> | 2762 | </div> |
| 2763 | <div class="section" id="cacosh"> | ||
| 2861 | <div class="header"> | 2764 | <div class="header"> |
| 2862 | <p> | 2765 | <p> |
| 2863 | Next: <a href="#carg" accesskey="n" rel="next">carg</a>, Previous: <a href="#cacos" accesskey="p" rel="previous">cacos</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2766 | Next: <a href="#carg" accesskey="n" rel="next"><code>carg</code>, <code>cargf</code>—argument (phase angle)</a>, Previous: <a href="#cacos" accesskey="p" rel="prev"><code>cacos</code>, <code>cacosf</code>—complex arc cosine</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2864 | </div> | 2767 | </div> |
| 2865 | <a name="cacosh_002c-cacoshf_002d_002d_002dcomplex-arc-hyperbolic-cosine"></a> | 2768 | <span id="cacosh_002c-cacoshf_002d_002d_002dcomplex-arc-hyperbolic-cosine"></span><h3 class="section">2.3 <code>cacosh</code>, <code>cacoshf</code>—complex arc hyperbolic cosine</h3> |
| 2866 | <h3 class="section">2.3 <code>cacosh</code>, <code>cacoshf</code>—complex arc hyperbolic cosine</h3> | 2769 | <span id="index-cacosh"></span> |
| 2867 | <a name="index-cacosh"></a> | 2770 | <span id="index-cacoshf"></span> |
| 2868 | <a name="index-cacoshf"></a> | ||
| 2869 | <p><strong>Synopsis</strong> | 2771 | <p><strong>Synopsis</strong> |
| 2870 | </p><div class="example"> | 2772 | </p><div class="example"> |
| 2871 | <pre class="example">#include <complex.h> | 2773 | <pre class="example">#include <complex.h> |
| @@ -2893,15 +2795,15 @@ imaginary axis. | |||
| 2893 | </p> | 2795 | </p> |
| 2894 | <br> | 2796 | <br> |
| 2895 | <hr> | 2797 | <hr> |
| 2896 | <a name="carg"></a> | 2798 | </div> |
| 2799 | <div class="section" id="carg"> | ||
| 2897 | <div class="header"> | 2800 | <div class="header"> |
| 2898 | <p> | 2801 | <p> |
| 2899 | Next: <a href="#casin" accesskey="n" rel="next">casin</a>, Previous: <a href="#cacosh" accesskey="p" rel="previous">cacosh</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2802 | Next: <a href="#casin" accesskey="n" rel="next"><code>casin</code>, <code>casinf</code>—complex arc sine</a>, Previous: <a href="#cacosh" accesskey="p" rel="prev"><code>cacosh</code>, <code>cacoshf</code>—complex arc hyperbolic cosine</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2900 | </div> | 2803 | </div> |
| 2901 | <a name="carg_002c-cargf_002d_002d_002dargument-_0028phase-angle_0029"></a> | 2804 | <span id="carg_002c-cargf_002d_002d_002dargument-_0028phase-angle_0029"></span><h3 class="section">2.4 <code>carg</code>, <code>cargf</code>—argument (phase angle)</h3> |
| 2902 | <h3 class="section">2.4 <code>carg</code>, <code>cargf</code>—argument (phase angle)</h3> | 2805 | <span id="index-carg"></span> |
| 2903 | <a name="index-carg"></a> | 2806 | <span id="index-cargf"></span> |
| 2904 | <a name="index-cargf"></a> | ||
| 2905 | <p><strong>Synopsis</strong> | 2807 | <p><strong>Synopsis</strong> |
| 2906 | </p><div class="example"> | 2808 | </p><div class="example"> |
| 2907 | <pre class="example">#include <complex.h> | 2809 | <pre class="example">#include <complex.h> |
| @@ -2927,15 +2829,15 @@ interval [-pi, +pi] | |||
| 2927 | </p> | 2829 | </p> |
| 2928 | <br> | 2830 | <br> |
| 2929 | <hr> | 2831 | <hr> |
| 2930 | <a name="casin"></a> | 2832 | </div> |
| 2833 | <div class="section" id="casin"> | ||
| 2931 | <div class="header"> | 2834 | <div class="header"> |
| 2932 | <p> | 2835 | <p> |
| 2933 | Next: <a href="#casinh" accesskey="n" rel="next">casinh</a>, Previous: <a href="#carg" accesskey="p" rel="previous">carg</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2836 | Next: <a href="#casinh" accesskey="n" rel="next"><code>casinh</code>, <code>casinhf</code>—complex arc hyperbolic sine</a>, Previous: <a href="#carg" accesskey="p" rel="prev"><code>carg</code>, <code>cargf</code>—argument (phase angle)</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2934 | </div> | 2837 | </div> |
| 2935 | <a name="casin_002c-casinf_002d_002d_002dcomplex-arc-sine"></a> | 2838 | <span id="casin_002c-casinf_002d_002d_002dcomplex-arc-sine"></span><h3 class="section">2.5 <code>casin</code>, <code>casinf</code>—complex arc sine</h3> |
| 2936 | <h3 class="section">2.5 <code>casin</code>, <code>casinf</code>—complex arc sine</h3> | 2839 | <span id="index-casin"></span> |
| 2937 | <a name="index-casin"></a> | 2840 | <span id="index-casinf"></span> |
| 2938 | <a name="index-casinf"></a> | ||
| 2939 | <p><strong>Synopsis</strong> | 2841 | <p><strong>Synopsis</strong> |
| 2940 | </p><div class="example"> | 2842 | </p><div class="example"> |
| 2941 | <pre class="example">#include <complex.h> | 2843 | <pre class="example">#include <complex.h> |
| @@ -2962,15 +2864,15 @@ and in the interval [-pi/2, +pi/2] along the real axis. | |||
| 2962 | </p> | 2864 | </p> |
| 2963 | <br> | 2865 | <br> |
| 2964 | <hr> | 2866 | <hr> |
| 2965 | <a name="casinh"></a> | 2867 | </div> |
| 2868 | <div class="section" id="casinh"> | ||
| 2966 | <div class="header"> | 2869 | <div class="header"> |
| 2967 | <p> | 2870 | <p> |
| 2968 | Next: <a href="#catan" accesskey="n" rel="next">catan</a>, Previous: <a href="#casin" accesskey="p" rel="previous">casin</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2871 | Next: <a href="#catan" accesskey="n" rel="next"><code>catan</code>, <code>catanf</code>—complex arc tangent</a>, Previous: <a href="#casin" accesskey="p" rel="prev"><code>casin</code>, <code>casinf</code>—complex arc sine</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 2969 | </div> | 2872 | </div> |
| 2970 | <a name="casinh_002c-casinhf_002d_002d_002dcomplex-arc-hyperbolic-sine"></a> | 2873 | <span id="casinh_002c-casinhf_002d_002d_002dcomplex-arc-hyperbolic-sine"></span><h3 class="section">2.6 <code>casinh</code>, <code>casinhf</code>—complex arc hyperbolic sine</h3> |
| 2971 | <h3 class="section">2.6 <code>casinh</code>, <code>casinhf</code>—complex arc hyperbolic sine</h3> | 2874 | <span id="index-casinh"></span> |
| 2972 | <a name="index-casinh"></a> | 2875 | <span id="index-casinhf"></span> |
| 2973 | <a name="index-casinhf"></a> | ||
| 2974 | <p><strong>Synopsis</strong> | 2876 | <p><strong>Synopsis</strong> |
| 2975 | </p><div class="example"> | 2877 | </p><div class="example"> |
| 2976 | <pre class="example">#include <complex.h> | 2878 | <pre class="example">#include <complex.h> |
| @@ -2999,15 +2901,15 @@ imaginary axis. | |||
| 2999 | </p> | 2901 | </p> |
| 3000 | <br> | 2902 | <br> |
| 3001 | <hr> | 2903 | <hr> |
| 3002 | <a name="catan"></a> | 2904 | </div> |
| 2905 | <div class="section" id="catan"> | ||
| 3003 | <div class="header"> | 2906 | <div class="header"> |
| 3004 | <p> | 2907 | <p> |
| 3005 | Next: <a href="#catanh" accesskey="n" rel="next">catanh</a>, Previous: <a href="#casinh" accesskey="p" rel="previous">casinh</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2908 | Next: <a href="#catanh" accesskey="n" rel="next"><code>catanh</code>, <code>catanhf</code>—complex arc hyperbolic tangent</a>, Previous: <a href="#casinh" accesskey="p" rel="prev"><code>casinh</code>, <code>casinhf</code>—complex arc hyperbolic sine</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3006 | </div> | 2909 | </div> |
| 3007 | <a name="catan_002c-catanf_002d_002d_002dcomplex-arc-tangent"></a> | 2910 | <span id="catan_002c-catanf_002d_002d_002dcomplex-arc-tangent"></span><h3 class="section">2.7 <code>catan</code>, <code>catanf</code>—complex arc tangent</h3> |
| 3008 | <h3 class="section">2.7 <code>catan</code>, <code>catanf</code>—complex arc tangent</h3> | 2911 | <span id="index-catan"></span> |
| 3009 | <a name="index-catan"></a> | 2912 | <span id="index-catanf"></span> |
| 3010 | <a name="index-catanf"></a> | ||
| 3011 | <p><strong>Synopsis</strong> | 2913 | <p><strong>Synopsis</strong> |
| 3012 | </p><div class="example"> | 2914 | </p><div class="example"> |
| 3013 | <pre class="example">#include <complex.h> | 2915 | <pre class="example">#include <complex.h> |
| @@ -3035,15 +2937,15 @@ and in the interval [-pi/2, +pi/2] along the real axis. | |||
| 3035 | </p> | 2937 | </p> |
| 3036 | <br> | 2938 | <br> |
| 3037 | <hr> | 2939 | <hr> |
| 3038 | <a name="catanh"></a> | 2940 | </div> |
| 2941 | <div class="section" id="catanh"> | ||
| 3039 | <div class="header"> | 2942 | <div class="header"> |
| 3040 | <p> | 2943 | <p> |
| 3041 | Next: <a href="#ccos" accesskey="n" rel="next">ccos</a>, Previous: <a href="#catan" accesskey="p" rel="previous">catan</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2944 | Next: <a href="#ccos" accesskey="n" rel="next"><code>ccos</code>, <code>ccosf</code>—complex cosine</a>, Previous: <a href="#catan" accesskey="p" rel="prev"><code>catan</code>, <code>catanf</code>—complex arc tangent</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3042 | </div> | 2945 | </div> |
| 3043 | <a name="catanh_002c-catanhf_002d_002d_002dcomplex-arc-hyperbolic-tangent"></a> | 2946 | <span id="catanh_002c-catanhf_002d_002d_002dcomplex-arc-hyperbolic-tangent"></span><h3 class="section">2.8 <code>catanh</code>, <code>catanhf</code>—complex arc hyperbolic tangent</h3> |
| 3044 | <h3 class="section">2.8 <code>catanh</code>, <code>catanhf</code>—complex arc hyperbolic tangent</h3> | 2947 | <span id="index-catanh"></span> |
| 3045 | <a name="index-catanh"></a> | 2948 | <span id="index-catanhf"></span> |
| 3046 | <a name="index-catanhf"></a> | ||
| 3047 | <p><strong>Synopsis</strong> | 2949 | <p><strong>Synopsis</strong> |
| 3048 | </p><div class="example"> | 2950 | </p><div class="example"> |
| 3049 | <pre class="example">#include <complex.h> | 2951 | <pre class="example">#include <complex.h> |
| @@ -3072,15 +2974,15 @@ imaginary axis. | |||
| 3072 | </p> | 2974 | </p> |
| 3073 | <br> | 2975 | <br> |
| 3074 | <hr> | 2976 | <hr> |
| 3075 | <a name="ccos"></a> | 2977 | </div> |
| 2978 | <div class="section" id="ccos"> | ||
| 3076 | <div class="header"> | 2979 | <div class="header"> |
| 3077 | <p> | 2980 | <p> |
| 3078 | Next: <a href="#ccosh" accesskey="n" rel="next">ccosh</a>, Previous: <a href="#catanh" accesskey="p" rel="previous">catanh</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 2981 | Next: <a href="#ccosh" accesskey="n" rel="next"><code>ccosh</code>, <code>ccoshf</code>—complex hyperbolic cosine</a>, Previous: <a href="#catanh" accesskey="p" rel="prev"><code>catanh</code>, <code>catanhf</code>—complex arc hyperbolic tangent</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3079 | </div> | 2982 | </div> |
| 3080 | <a name="ccos_002c-ccosf_002d_002d_002dcomplex-cosine"></a> | 2983 | <span id="ccos_002c-ccosf_002d_002d_002dcomplex-cosine"></span><h3 class="section">2.9 <code>ccos</code>, <code>ccosf</code>—complex cosine</h3> |
| 3081 | <h3 class="section">2.9 <code>ccos</code>, <code>ccosf</code>—complex cosine</h3> | 2984 | <span id="index-ccos"></span> |
| 3082 | <a name="index-ccos"></a> | 2985 | <span id="index-ccosf"></span> |
| 3083 | <a name="index-ccosf"></a> | ||
| 3084 | <p><strong>Synopsis</strong> | 2986 | <p><strong>Synopsis</strong> |
| 3085 | </p><div class="example"> | 2987 | </p><div class="example"> |
| 3086 | <pre class="example">#include <complex.h> | 2988 | <pre class="example">#include <complex.h> |
| @@ -3104,15 +3006,15 @@ These functions return the complex cosine value. | |||
| 3104 | </p> | 3006 | </p> |
| 3105 | <br> | 3007 | <br> |
| 3106 | <hr> | 3008 | <hr> |
| 3107 | <a name="ccosh"></a> | 3009 | </div> |
| 3010 | <div class="section" id="ccosh"> | ||
| 3108 | <div class="header"> | 3011 | <div class="header"> |
| 3109 | <p> | 3012 | <p> |
| 3110 | Next: <a href="#cexp" accesskey="n" rel="next">cexp</a>, Previous: <a href="#ccos" accesskey="p" rel="previous">ccos</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3013 | Next: <a href="#cexp" accesskey="n" rel="next"><code>cexp</code>, <code>cexpf</code>—complex base-e exponential</a>, Previous: <a href="#ccos" accesskey="p" rel="prev"><code>ccos</code>, <code>ccosf</code>—complex cosine</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3111 | </div> | 3014 | </div> |
| 3112 | <a name="ccosh_002c-ccoshf_002d_002d_002dcomplex-hyperbolic-cosine"></a> | 3015 | <span id="ccosh_002c-ccoshf_002d_002d_002dcomplex-hyperbolic-cosine"></span><h3 class="section">2.10 <code>ccosh</code>, <code>ccoshf</code>—complex hyperbolic cosine</h3> |
| 3113 | <h3 class="section">2.10 <code>ccosh</code>, <code>ccoshf</code>—complex hyperbolic cosine</h3> | 3016 | <span id="index-ccosh"></span> |
| 3114 | <a name="index-ccosh"></a> | 3017 | <span id="index-ccoshf"></span> |
| 3115 | <a name="index-ccoshf"></a> | ||
| 3116 | <p><strong>Synopsis</strong> | 3018 | <p><strong>Synopsis</strong> |
| 3117 | </p><div class="example"> | 3019 | </p><div class="example"> |
| 3118 | <pre class="example">#include <complex.h> | 3020 | <pre class="example">#include <complex.h> |
| @@ -3136,15 +3038,15 @@ These functions return the complex hyperbolic cosine value. | |||
| 3136 | </p> | 3038 | </p> |
| 3137 | <br> | 3039 | <br> |
| 3138 | <hr> | 3040 | <hr> |
| 3139 | <a name="cexp"></a> | 3041 | </div> |
| 3042 | <div class="section" id="cexp"> | ||
| 3140 | <div class="header"> | 3043 | <div class="header"> |
| 3141 | <p> | 3044 | <p> |
| 3142 | Next: <a href="#cimag" accesskey="n" rel="next">cimag</a>, Previous: <a href="#ccosh" accesskey="p" rel="previous">ccosh</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3045 | Next: <a href="#cimag" accesskey="n" rel="next"><code>cimag</code>, <code>cimagf</code>, <code>cimagl</code>—imaginary part</a>, Previous: <a href="#ccosh" accesskey="p" rel="prev"><code>ccosh</code>, <code>ccoshf</code>—complex hyperbolic cosine</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3143 | </div> | 3046 | </div> |
| 3144 | <a name="cexp_002c-cexpf_002d_002d_002dcomplex-base_002de-exponential"></a> | 3047 | <span id="cexp_002c-cexpf_002d_002d_002dcomplex-base_002de-exponential"></span><h3 class="section">2.11 <code>cexp</code>, <code>cexpf</code>—complex base-e exponential</h3> |
| 3145 | <h3 class="section">2.11 <code>cexp</code>, <code>cexpf</code>—complex base-e exponential</h3> | 3048 | <span id="index-cexp"></span> |
| 3146 | <a name="index-cexp"></a> | 3049 | <span id="index-cexpf"></span> |
| 3147 | <a name="index-cexpf"></a> | ||
| 3148 | <p><strong>Synopsis</strong> | 3050 | <p><strong>Synopsis</strong> |
| 3149 | </p><div class="example"> | 3051 | </p><div class="example"> |
| 3150 | <pre class="example">#include <complex.h> | 3052 | <pre class="example">#include <complex.h> |
| @@ -3168,47 +3070,52 @@ The cexp functions return the complex base-<var>e</var> exponential value. | |||
| 3168 | </p> | 3070 | </p> |
| 3169 | <br> | 3071 | <br> |
| 3170 | <hr> | 3072 | <hr> |
| 3171 | <a name="cimag"></a> | 3073 | </div> |
| 3074 | <div class="section" id="cimag"> | ||
| 3172 | <div class="header"> | 3075 | <div class="header"> |
| 3173 | <p> | 3076 | <p> |
| 3174 | Next: <a href="#clog" accesskey="n" rel="next">clog</a>, Previous: <a href="#cexp" accesskey="p" rel="previous">cexp</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3077 | Next: <a href="#clog" accesskey="n" rel="next"><code>clog</code>, <code>clogf</code>—complex base-e logarithm</a>, Previous: <a href="#cexp" accesskey="p" rel="prev"><code>cexp</code>, <code>cexpf</code>—complex base-e exponential</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3175 | </div> | 3078 | </div> |
| 3176 | <a name="cimag_002c-cimagf_002d_002d_002dimaginary-part"></a> | 3079 | <span id="cimag_002c-cimagf_002c-cimagl_002d_002d_002dimaginary-part"></span><h3 class="section">2.12 <code>cimag</code>, <code>cimagf</code>, <code>cimagl</code>—imaginary part</h3> |
| 3177 | <h3 class="section">2.12 <code>cimag</code>, <code>cimagf</code>—imaginary part</h3> | 3080 | <span id="index-cimag"></span> |
| 3178 | <a name="index-cimag"></a> | 3081 | <span id="index-cimagf"></span> |
| 3179 | <a name="index-cimagf"></a> | 3082 | <span id="index-cimagl"></span> |
| 3180 | <p><strong>Synopsis</strong> | 3083 | <p><strong>Synopsis</strong> |
| 3181 | </p><div class="example"> | 3084 | </p><div class="example"> |
| 3182 | <pre class="example">#include <complex.h> | 3085 | <pre class="example">#include <complex.h> |
| 3183 | double cimag(double complex <var>z</var>); | 3086 | double cimag(double complex <var>z</var>); |
| 3184 | float cimagf(float complex <var>z</var>); | 3087 | float cimagf(float complex <var>z</var>); |
| 3088 | long double cimagl(long double complex <var>z</var>); | ||
| 3185 | 3089 | ||
| 3186 | </pre></div> | 3090 | </pre></div> |
| 3187 | <p><strong>Description</strong><br> | 3091 | <p><strong>Description</strong><br> |
| 3188 | These functions compute the imaginary part of <var>z</var>. | 3092 | These functions compute the imaginary part of <var>z</var>. |
| 3189 | </p> | 3093 | </p> |
| 3190 | <p><code>cimagf</code> is identical to <code>cimag</code>, except that it performs | 3094 | <p><code>cimagf</code> is identical to <code>cimag</code>, except that it performs |
| 3191 | its calculations on <code>floats complex</code>. | 3095 | its calculations on <code>float complex</code>. |
| 3096 | </p> | ||
| 3097 | <p><code>cimagl</code> is identical to <code>cimag</code>, except that it performs | ||
| 3098 | its calculations on <code>long double complex</code>. | ||
| 3192 | </p> | 3099 | </p> |
| 3193 | <br> | 3100 | <br> |
| 3194 | <p><strong>Returns</strong><br> | 3101 | <p><strong>Returns</strong><br> |
| 3195 | The cimag functions return the imaginary part value (as a real). | 3102 | The cimag* functions return the imaginary part value (as a real). |
| 3196 | </p> | 3103 | </p> |
| 3197 | <br> | 3104 | <br> |
| 3198 | <p><strong>Portability</strong><br> | 3105 | <p><strong>Portability</strong><br> |
| 3199 | <code>cimag</code> and <code>cimagf</code> are ISO C99 | 3106 | <code>cimag</code>, <code>cimagf</code> and <code>cimagl</code> are ISO C99 |
| 3200 | </p> | 3107 | </p> |
| 3201 | <br> | 3108 | <br> |
| 3202 | <hr> | 3109 | <hr> |
| 3203 | <a name="clog"></a> | 3110 | </div> |
| 3111 | <div class="section" id="clog"> | ||
| 3204 | <div class="header"> | 3112 | <div class="header"> |
| 3205 | <p> | 3113 | <p> |
| 3206 | Next: <a href="#conj" accesskey="n" rel="next">conj</a>, Previous: <a href="#cimag" accesskey="p" rel="previous">cimag</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3114 | Next: <a href="#clog10" accesskey="n" rel="next"><code>clog10</code>, <code>clog10f</code>—complex base-10 logarithm</a>, Previous: <a href="#cimag" accesskey="p" rel="prev"><code>cimag</code>, <code>cimagf</code>, <code>cimagl</code>—imaginary part</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3207 | </div> | 3115 | </div> |
| 3208 | <a name="clog_002c-clogf_002d_002d_002dcomplex-base_002de-logarithm"></a> | 3116 | <span id="clog_002c-clogf_002d_002d_002dcomplex-base_002de-logarithm"></span><h3 class="section">2.13 <code>clog</code>, <code>clogf</code>—complex base-e logarithm</h3> |
| 3209 | <h3 class="section">2.13 <code>clog</code>, <code>clogf</code>—complex base-e logarithm</h3> | 3117 | <span id="index-clog"></span> |
| 3210 | <a name="index-clog"></a> | 3118 | <span id="index-clogf"></span> |
| 3211 | <a name="index-clogf"></a> | ||
| 3212 | <p><strong>Synopsis</strong> | 3119 | <p><strong>Synopsis</strong> |
| 3213 | </p><div class="example"> | 3120 | </p><div class="example"> |
| 3214 | <pre class="example">#include <complex.h> | 3121 | <pre class="example">#include <complex.h> |
| @@ -3235,15 +3142,50 @@ and in the interval [-i*pi , +i*pi] along the imaginary axis. | |||
| 3235 | </p> | 3142 | </p> |
| 3236 | <br> | 3143 | <br> |
| 3237 | <hr> | 3144 | <hr> |
| 3238 | <a name="conj"></a> | 3145 | </div> |
| 3146 | <div class="section" id="clog10"> | ||
| 3147 | <div class="header"> | ||
| 3148 | <p> | ||
| 3149 | Next: <a href="#conj" accesskey="n" rel="next"><code>conj</code>, <code>conjf</code>—complex conjugate</a>, Previous: <a href="#clog" accesskey="p" rel="prev"><code>clog</code>, <code>clogf</code>—complex base-e logarithm</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3150 | </div> | ||
| 3151 | <span id="clog10_002c-clog10f_002d_002d_002dcomplex-base_002d10-logarithm"></span><h3 class="section">2.14 <code>clog10</code>, <code>clog10f</code>—complex base-10 logarithm</h3> | ||
| 3152 | <span id="index-clog10"></span> | ||
| 3153 | <span id="index-clog10f"></span> | ||
| 3154 | <p><strong>Synopsis</strong> | ||
| 3155 | </p><div class="example"> | ||
| 3156 | <pre class="example">#define _GNU_SOURCE | ||
| 3157 | #include <complex.h> | ||
| 3158 | double complex clog10(double complex <var>z</var>); | ||
| 3159 | float complex clog10f(float complex <var>z</var>); | ||
| 3160 | |||
| 3161 | </pre></div> | ||
| 3162 | <p><strong>Description</strong><br> | ||
| 3163 | These functions compute the complex base-10 logarithm of <var>z</var>. | ||
| 3164 | <code>clog10</code> is equivalent to <code>clog</code>(<var>z</var>)/<code>log</code>(10). | ||
| 3165 | </p> | ||
| 3166 | <p><code>clog10f</code> is identical to <code>clog10</code>, except that it performs | ||
| 3167 | its calculations on <code>floats complex</code>. | ||
| 3168 | </p> | ||
| 3169 | <br> | ||
| 3170 | <p><strong>Returns</strong><br> | ||
| 3171 | The clog10 functions return the complex base-10 logarithm value. | ||
| 3172 | </p> | ||
| 3173 | <br> | ||
| 3174 | <p><strong>Portability</strong><br> | ||
| 3175 | <code>clog10</code> and <code>clog10f</code> are GNU extensions. | ||
| 3176 | </p> | ||
| 3177 | |||
| 3178 | <br> | ||
| 3179 | <hr> | ||
| 3180 | </div> | ||
| 3181 | <div class="section" id="conj"> | ||
| 3239 | <div class="header"> | 3182 | <div class="header"> |
| 3240 | <p> | 3183 | <p> |
| 3241 | Next: <a href="#cpow" accesskey="n" rel="next">cpow</a>, Previous: <a href="#clog" accesskey="p" rel="previous">clog</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3184 | Next: <a href="#cpow" accesskey="n" rel="next"><code>cpow</code>, <code>cpowf</code>—complex power</a>, Previous: <a href="#clog10" accesskey="p" rel="prev"><code>clog10</code>, <code>clog10f</code>—complex base-10 logarithm</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3242 | </div> | 3185 | </div> |
| 3243 | <a name="conj_002c-conjf_002d_002d_002dcomplex-conjugate"></a> | 3186 | <span id="conj_002c-conjf_002d_002d_002dcomplex-conjugate"></span><h3 class="section">2.15 <code>conj</code>, <code>conjf</code>—complex conjugate</h3> |
| 3244 | <h3 class="section">2.14 <code>conj</code>, <code>conjf</code>—complex conjugate</h3> | 3187 | <span id="index-conj"></span> |
| 3245 | <a name="index-conj"></a> | 3188 | <span id="index-conjf"></span> |
| 3246 | <a name="index-conjf"></a> | ||
| 3247 | <p><strong>Synopsis</strong> | 3189 | <p><strong>Synopsis</strong> |
| 3248 | </p><div class="example"> | 3190 | </p><div class="example"> |
| 3249 | <pre class="example">#include <complex.h> | 3191 | <pre class="example">#include <complex.h> |
| @@ -3268,15 +3210,15 @@ The conj functions return the complex conjugate value. | |||
| 3268 | </p> | 3210 | </p> |
| 3269 | <br> | 3211 | <br> |
| 3270 | <hr> | 3212 | <hr> |
| 3271 | <a name="cpow"></a> | 3213 | </div> |
| 3214 | <div class="section" id="cpow"> | ||
| 3272 | <div class="header"> | 3215 | <div class="header"> |
| 3273 | <p> | 3216 | <p> |
| 3274 | Next: <a href="#cproj" accesskey="n" rel="next">cproj</a>, Previous: <a href="#conj" accesskey="p" rel="previous">conj</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3217 | Next: <a href="#cproj" accesskey="n" rel="next"><code>cproj</code>, <code>cprojf</code>— Riemann sphere projection</a>, Previous: <a href="#conj" accesskey="p" rel="prev"><code>conj</code>, <code>conjf</code>—complex conjugate</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3275 | </div> | 3218 | </div> |
| 3276 | <a name="cpow_002c-cpowf_002d_002d_002dcomplex-power"></a> | 3219 | <span id="cpow_002c-cpowf_002d_002d_002dcomplex-power"></span><h3 class="section">2.16 <code>cpow</code>, <code>cpowf</code>—complex power</h3> |
| 3277 | <h3 class="section">2.15 <code>cpow</code>, <code>cpowf</code>—complex power</h3> | 3220 | <span id="index-cpow"></span> |
| 3278 | <a name="index-cpow"></a> | 3221 | <span id="index-cpowf"></span> |
| 3279 | <a name="index-cpowf"></a> | ||
| 3280 | <p><strong>Synopsis</strong> | 3222 | <p><strong>Synopsis</strong> |
| 3281 | </p><div class="example"> | 3223 | </p><div class="example"> |
| 3282 | <pre class="example">#include <complex.h> | 3224 | <pre class="example">#include <complex.h> |
| @@ -3302,15 +3244,15 @@ The cpow functions return the complex power function value. | |||
| 3302 | </p> | 3244 | </p> |
| 3303 | <br> | 3245 | <br> |
| 3304 | <hr> | 3246 | <hr> |
| 3305 | <a name="cproj"></a> | 3247 | </div> |
| 3248 | <div class="section" id="cproj"> | ||
| 3306 | <div class="header"> | 3249 | <div class="header"> |
| 3307 | <p> | 3250 | <p> |
| 3308 | Next: <a href="#creal" accesskey="n" rel="next">creal</a>, Previous: <a href="#cpow" accesskey="p" rel="previous">cpow</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3251 | Next: <a href="#creal" accesskey="n" rel="next"><code>creal</code>, <code>crealf</code>, <code>creall</code>—real part</a>, Previous: <a href="#cpow" accesskey="p" rel="prev"><code>cpow</code>, <code>cpowf</code>—complex power</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3309 | </div> | 3252 | </div> |
| 3310 | <a name="cproj_002c-cprojf_002d_002d_002d-Riemann-sphere-projection"></a> | 3253 | <span id="cproj_002c-cprojf_002d_002d_002d-Riemann-sphere-projection"></span><h3 class="section">2.17 <code>cproj</code>, <code>cprojf</code>— Riemann sphere projection</h3> |
| 3311 | <h3 class="section">2.16 <code>cproj</code>, <code>cprojf</code>— Riemann sphere projection</h3> | 3254 | <span id="index-cproj"></span> |
| 3312 | <a name="index-cproj"></a> | 3255 | <span id="index-cprojf"></span> |
| 3313 | <a name="index-cprojf"></a> | ||
| 3314 | <p><strong>Synopsis</strong> | 3256 | <p><strong>Synopsis</strong> |
| 3315 | </p><div class="example"> | 3257 | </p><div class="example"> |
| 3316 | <pre class="example">#include <complex.h> | 3258 | <pre class="example">#include <complex.h> |
| @@ -3341,47 +3283,52 @@ the Riemann sphere. | |||
| 3341 | </p> | 3283 | </p> |
| 3342 | <br> | 3284 | <br> |
| 3343 | <hr> | 3285 | <hr> |
| 3344 | <a name="creal"></a> | 3286 | </div> |
| 3287 | <div class="section" id="creal"> | ||
| 3345 | <div class="header"> | 3288 | <div class="header"> |
| 3346 | <p> | 3289 | <p> |
| 3347 | Next: <a href="#csin" accesskey="n" rel="next">csin</a>, Previous: <a href="#cproj" accesskey="p" rel="previous">cproj</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3290 | Next: <a href="#csin" accesskey="n" rel="next"><code>csin</code>, <code>csinf</code>—complex sine</a>, Previous: <a href="#cproj" accesskey="p" rel="prev"><code>cproj</code>, <code>cprojf</code>— Riemann sphere projection</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3348 | </div> | 3291 | </div> |
| 3349 | <a name="creal_002c-crealf_002d_002d_002dreal-part"></a> | 3292 | <span id="creal_002c-crealf_002c-creall_002d_002d_002dreal-part"></span><h3 class="section">2.18 <code>creal</code>, <code>crealf</code>, <code>creall</code>—real part</h3> |
| 3350 | <h3 class="section">2.17 <code>creal</code>, <code>crealf</code>—real part</h3> | 3293 | <span id="index-creal"></span> |
| 3351 | <a name="index-creal"></a> | 3294 | <span id="index-crealf"></span> |
| 3352 | <a name="index-crealf"></a> | 3295 | <span id="index-creall"></span> |
| 3353 | <p><strong>Synopsis</strong> | 3296 | <p><strong>Synopsis</strong> |
| 3354 | </p><div class="example"> | 3297 | </p><div class="example"> |
| 3355 | <pre class="example">#include <complex.h> | 3298 | <pre class="example">#include <complex.h> |
| 3356 | double creal(double complex <var>z</var>); | 3299 | double creal(double complex <var>z</var>); |
| 3357 | float crealf(float complex <var>z</var>); | 3300 | float crealf(float complex <var>z</var>); |
| 3301 | double long creall(long double complex <var>z</var>); | ||
| 3358 | 3302 | ||
| 3359 | </pre></div> | 3303 | </pre></div> |
| 3360 | <p><strong>Description</strong><br> | 3304 | <p><strong>Description</strong><br> |
| 3361 | These functions compute the real part of <var>z</var>. | 3305 | These functions compute the real part of <var>z</var>. |
| 3362 | </p> | 3306 | </p> |
| 3363 | <p><code>crealf</code> is identical to <code>creal</code>, except that it performs | 3307 | <p><code>crealf</code> is identical to <code>creal</code>, except that it performs |
| 3364 | its calculations on <code>floats complex</code>. | 3308 | its calculations on <code>float complex</code>. |
| 3309 | </p> | ||
| 3310 | <p><code>creall</code> is identical to <code>creal</code>, except that it performs | ||
| 3311 | its calculations on <code>long double complex</code>. | ||
| 3365 | </p> | 3312 | </p> |
| 3366 | <br> | 3313 | <br> |
| 3367 | <p><strong>Returns</strong><br> | 3314 | <p><strong>Returns</strong><br> |
| 3368 | The creal functions return the real part value. | 3315 | The creal* functions return the real part value. |
| 3369 | </p> | 3316 | </p> |
| 3370 | <br> | 3317 | <br> |
| 3371 | <p><strong>Portability</strong><br> | 3318 | <p><strong>Portability</strong><br> |
| 3372 | <code>creal</code> and <code>crealf</code> are ISO C99 | 3319 | <code>creal</code>, <code>crealf</code> and <code>creall</code> are ISO C99 |
| 3373 | </p> | 3320 | </p> |
| 3374 | <br> | 3321 | <br> |
| 3375 | <hr> | 3322 | <hr> |
| 3376 | <a name="csin"></a> | 3323 | </div> |
| 3324 | <div class="section" id="csin"> | ||
| 3377 | <div class="header"> | 3325 | <div class="header"> |
| 3378 | <p> | 3326 | <p> |
| 3379 | Next: <a href="#csinh" accesskey="n" rel="next">csinh</a>, Previous: <a href="#creal" accesskey="p" rel="previous">creal</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3327 | Next: <a href="#csinh" accesskey="n" rel="next"><code>csinh</code>, <code>csinhf</code>—complex hyperbolic sine</a>, Previous: <a href="#creal" accesskey="p" rel="prev"><code>creal</code>, <code>crealf</code>, <code>creall</code>—real part</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3380 | </div> | 3328 | </div> |
| 3381 | <a name="csin_002c-csinf_002d_002d_002dcomplex-sine"></a> | 3329 | <span id="csin_002c-csinf_002d_002d_002dcomplex-sine"></span><h3 class="section">2.19 <code>csin</code>, <code>csinf</code>—complex sine</h3> |
| 3382 | <h3 class="section">2.18 <code>csin</code>, <code>csinf</code>—complex sine</h3> | 3330 | <span id="index-csin"></span> |
| 3383 | <a name="index-csin"></a> | 3331 | <span id="index-csinf"></span> |
| 3384 | <a name="index-csinf"></a> | ||
| 3385 | <p><strong>Synopsis</strong> | 3332 | <p><strong>Synopsis</strong> |
| 3386 | </p><div class="example"> | 3333 | </p><div class="example"> |
| 3387 | <pre class="example">#include <complex.h> | 3334 | <pre class="example">#include <complex.h> |
| @@ -3405,15 +3352,15 @@ These functions return the complex sine value. | |||
| 3405 | </p> | 3352 | </p> |
| 3406 | <br> | 3353 | <br> |
| 3407 | <hr> | 3354 | <hr> |
| 3408 | <a name="csinh"></a> | 3355 | </div> |
| 3356 | <div class="section" id="csinh"> | ||
| 3409 | <div class="header"> | 3357 | <div class="header"> |
| 3410 | <p> | 3358 | <p> |
| 3411 | Next: <a href="#csqrt" accesskey="n" rel="next">csqrt</a>, Previous: <a href="#csin" accesskey="p" rel="previous">csin</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3359 | Next: <a href="#csqrt" accesskey="n" rel="next"><code>csqrt</code>, <code>csqrtf</code>—complex square root</a>, Previous: <a href="#csin" accesskey="p" rel="prev"><code>csin</code>, <code>csinf</code>—complex sine</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3412 | </div> | 3360 | </div> |
| 3413 | <a name="csinh_002c-csinhf_002d_002d_002dcomplex-hyperbolic-sine"></a> | 3361 | <span id="csinh_002c-csinhf_002d_002d_002dcomplex-hyperbolic-sine"></span><h3 class="section">2.20 <code>csinh</code>, <code>csinhf</code>—complex hyperbolic sine</h3> |
| 3414 | <h3 class="section">2.19 <code>csinh</code>, <code>csinhf</code>—complex hyperbolic sine</h3> | 3362 | <span id="index-csinh"></span> |
| 3415 | <a name="index-csinh"></a> | 3363 | <span id="index-csinhf"></span> |
| 3416 | <a name="index-csinhf"></a> | ||
| 3417 | <p><strong>Synopsis</strong> | 3364 | <p><strong>Synopsis</strong> |
| 3418 | </p><div class="example"> | 3365 | </p><div class="example"> |
| 3419 | <pre class="example">#include <complex.h> | 3366 | <pre class="example">#include <complex.h> |
| @@ -3437,15 +3384,15 @@ These functions return the complex hyperbolic sine value. | |||
| 3437 | </p> | 3384 | </p> |
| 3438 | <br> | 3385 | <br> |
| 3439 | <hr> | 3386 | <hr> |
| 3440 | <a name="csqrt"></a> | 3387 | </div> |
| 3388 | <div class="section" id="csqrt"> | ||
| 3441 | <div class="header"> | 3389 | <div class="header"> |
| 3442 | <p> | 3390 | <p> |
| 3443 | Next: <a href="#ctan" accesskey="n" rel="next">ctan</a>, Previous: <a href="#csinh" accesskey="p" rel="previous">csinh</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3391 | Next: <a href="#ctan" accesskey="n" rel="next"><code>ctan</code>, <code>ctanf</code>—complex tangent</a>, Previous: <a href="#csinh" accesskey="p" rel="prev"><code>csinh</code>, <code>csinhf</code>—complex hyperbolic sine</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3444 | </div> | 3392 | </div> |
| 3445 | <a name="csqrt_002c-csqrtf_002d_002d_002dcomplex-square-root"></a> | 3393 | <span id="csqrt_002c-csqrtf_002d_002d_002dcomplex-square-root"></span><h3 class="section">2.21 <code>csqrt</code>, <code>csqrtf</code>—complex square root</h3> |
| 3446 | <h3 class="section">2.20 <code>csqrt</code>, <code>csqrtf</code>—complex square root</h3> | 3394 | <span id="index-csqrt"></span> |
| 3447 | <a name="index-csqrt"></a> | 3395 | <span id="index-csqrtf"></span> |
| 3448 | <a name="index-csqrtf"></a> | ||
| 3449 | <p><strong>Synopsis</strong> | 3396 | <p><strong>Synopsis</strong> |
| 3450 | </p><div class="example"> | 3397 | </p><div class="example"> |
| 3451 | <pre class="example">#include <complex.h> | 3398 | <pre class="example">#include <complex.h> |
| @@ -3471,15 +3418,15 @@ the range of the right halfplane (including the imaginary axis). | |||
| 3471 | </p> | 3418 | </p> |
| 3472 | <br> | 3419 | <br> |
| 3473 | <hr> | 3420 | <hr> |
| 3474 | <a name="ctan"></a> | 3421 | </div> |
| 3422 | <div class="section" id="ctan"> | ||
| 3475 | <div class="header"> | 3423 | <div class="header"> |
| 3476 | <p> | 3424 | <p> |
| 3477 | Next: <a href="#ctanh" accesskey="n" rel="next">ctanh</a>, Previous: <a href="#csqrt" accesskey="p" rel="previous">csqrt</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3425 | Next: <a href="#ctanh" accesskey="n" rel="next"><code>ctanh</code>, <code>ctanf</code>—complex hyperbolic tangent</a>, Previous: <a href="#csqrt" accesskey="p" rel="prev"><code>csqrt</code>, <code>csqrtf</code>—complex square root</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3478 | </div> | 3426 | </div> |
| 3479 | <a name="ctan_002c-ctanf_002d_002d_002dcomplex-tangent"></a> | 3427 | <span id="ctan_002c-ctanf_002d_002d_002dcomplex-tangent"></span><h3 class="section">2.22 <code>ctan</code>, <code>ctanf</code>—complex tangent</h3> |
| 3480 | <h3 class="section">2.21 <code>ctan</code>, <code>ctanf</code>—complex tangent</h3> | 3428 | <span id="index-ctan"></span> |
| 3481 | <a name="index-ctan"></a> | 3429 | <span id="index-ctanf"></span> |
| 3482 | <a name="index-ctanf"></a> | ||
| 3483 | <p><strong>Synopsis</strong> | 3430 | <p><strong>Synopsis</strong> |
| 3484 | </p><div class="example"> | 3431 | </p><div class="example"> |
| 3485 | <pre class="example">#include <complex.h> | 3432 | <pre class="example">#include <complex.h> |
| @@ -3503,15 +3450,15 @@ These functions return the complex tangent value. | |||
| 3503 | </p> | 3450 | </p> |
| 3504 | <br> | 3451 | <br> |
| 3505 | <hr> | 3452 | <hr> |
| 3506 | <a name="ctanh"></a> | 3453 | </div> |
| 3454 | <div class="section" id="ctanh"> | ||
| 3507 | <div class="header"> | 3455 | <div class="header"> |
| 3508 | <p> | 3456 | <p> |
| 3509 | Previous: <a href="#ctan" accesskey="p" rel="previous">ctan</a>, Up: <a href="#Complex" accesskey="u" rel="up">Complex</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3457 | Previous: <a href="#ctan" accesskey="p" rel="prev"><code>ctan</code>, <code>ctanf</code>—complex tangent</a>, Up: <a href="#Complex" accesskey="u" rel="up">Mathematical Complex Functions (<samp>complex.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3510 | </div> | 3458 | </div> |
| 3511 | <a name="ctanh_002c-ctanf_002d_002d_002dcomplex-hyperbolic-tangent"></a> | 3459 | <span id="ctanh_002c-ctanf_002d_002d_002dcomplex-hyperbolic-tangent"></span><h3 class="section">2.23 <code>ctanh</code>, <code>ctanf</code>—complex hyperbolic tangent</h3> |
| 3512 | <h3 class="section">2.22 <code>ctanh</code>, <code>ctanf</code>—complex hyperbolic tangent</h3> | 3460 | <span id="index-ctanh"></span> |
| 3513 | <a name="index-ctanh"></a> | 3461 | <span id="index-ctanhf"></span> |
| 3514 | <a name="index-ctanhf"></a> | ||
| 3515 | <p><strong>Synopsis</strong> | 3462 | <p><strong>Synopsis</strong> |
| 3516 | </p><div class="example"> | 3463 | </p><div class="example"> |
| 3517 | <pre class="example">#include <complex.h> | 3464 | <pre class="example">#include <complex.h> |
| @@ -3534,461 +3481,496 @@ These functions return the complex hyperbolic tangent value. | |||
| 3534 | <code>ctanh</code> and <code>ctanhf</code> are ISO C99 | 3481 | <code>ctanh</code> and <code>ctanhf</code> are ISO C99 |
| 3535 | </p> | 3482 | </p> |
| 3536 | <br> | 3483 | <br> |
| 3484 | <hr> | ||
| 3485 | </div> | ||
| 3486 | </div> | ||
| 3487 | <div class="chapter" id="Fenv"> | ||
| 3488 | <div class="header"> | ||
| 3489 | <p> | ||
| 3490 | Next: <a href="#Reentrancy" accesskey="n" rel="next">Reentrancy Properties of <code>libm</code></a>, Previous: <a href="#Complex" accesskey="p" rel="prev">Mathematical Complex Functions (<samp>complex.h</samp>)</a>, Up: <a href="#Top" accesskey="u" rel="up">LIBM</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3491 | </div> | ||
| 3492 | <span id="Floating_002dPoint-Environment-_0028fenv_002eh_0029"></span><h2 class="chapter">3 Floating-Point Environment (<samp>fenv.h</samp>)</h2> | ||
| 3537 | 3493 | ||
| 3494 | <p>This chapter groups the methods used to manipulate the floating-point | ||
| 3495 | status flags. Floating-point operations modify the floating-point | ||
| 3496 | status flags to indicate abnormal result information. | ||
| 3497 | </p> | ||
| 3498 | <p>The implementation of these methods is architecture specific. | ||
| 3499 | </p> | ||
| 3500 | |||
| 3501 | <ul class="section-toc"> | ||
| 3502 | <li><a href="#feclearexcept" accesskey="1"><code>feclearexcept</code>—clear floating-point exception</a></li> | ||
| 3503 | <li><a href="#fegetenv" accesskey="2"><code>fegetenv</code>—get current floating-point environment</a></li> | ||
| 3504 | <li><a href="#fegetexceptflag" accesskey="3"><code>fegetexceptflag</code>—get floating-point status flags</a></li> | ||
| 3505 | <li><a href="#fegetround" accesskey="4"><code>fegetround</code>—get current rounding direction</a></li> | ||
| 3506 | <li><a href="#feholdexcept" accesskey="5"><code>feholdexcept</code>—save current floating-point environment</a></li> | ||
| 3507 | <li><a href="#feraiseexcept" accesskey="6"><code>feraiseexcept</code>—raise floating-point exception</a></li> | ||
| 3508 | <li><a href="#fesetenv" accesskey="7"><code>fesetenv</code>—set current floating-point environment</a></li> | ||
| 3509 | <li><a href="#fesetexceptflag" accesskey="8"><code>fesetexceptflag</code>—set floating-point status flags</a></li> | ||
| 3510 | <li><a href="#fesetround" accesskey="9"><code>fesetround</code>—set current rounding direction</a></li> | ||
| 3511 | <li><a href="#fetestexcept"><code>fetestexcept</code>—test floating-point exception flags</a></li> | ||
| 3512 | <li><a href="#feupdateenv"><code>feupdateenv</code>—update current floating-point environment</a></li> | ||
| 3513 | </ul> | ||
| 3538 | <hr> | 3514 | <hr> |
| 3539 | <a name="Reentrancy"></a> | 3515 | <div class="section" id="feclearexcept"> |
| 3540 | <div class="header"> | 3516 | <div class="header"> |
| 3541 | <p> | 3517 | <p> |
| 3542 | Next: <a href="#Long-Double-Functions" accesskey="n" rel="next">Long Double Functions</a>, Previous: <a href="#Complex" accesskey="p" rel="previous">Complex</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3518 | Next: <a href="#fegetenv" accesskey="n" rel="next"><code>fegetenv</code>—get current floating-point environment</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3543 | </div> | 3519 | </div> |
| 3544 | <a name="Reentrancy-Properties-of-libm"></a> | 3520 | <span id="feclearexcept_002d_002d_002dclear-floating_002dpoint-exception"></span><h3 class="section">3.1 <code>feclearexcept</code>—clear floating-point exception</h3> |
| 3545 | <h2 class="chapter">3 Reentrancy Properties of <code>libm</code></h2> | 3521 | <span id="index-feclearexcept"></span> |
| 3522 | <p><strong>Synopsis</strong> | ||
| 3523 | </p><div class="example"> | ||
| 3524 | <pre class="example">#include <fenv.h> | ||
| 3525 | int feclearexcept(int <var>except</var>); | ||
| 3546 | 3526 | ||
| 3547 | <a name="index-reentrancy"></a> | 3527 | Link with -lm. |
| 3548 | <a name="index-matherr-and-reentrancy"></a> | 3528 | |
| 3549 | <p>When a libm function detects an exceptional case, <code>errno</code> may be | 3529 | </pre></div> |
| 3550 | set, the <code>matherr</code> function may be called, and a error message | 3530 | <p><strong>Description</strong><br> |
| 3551 | may be written to the standard error stream. This behavior may not | 3531 | This method attempts to clear the floating-point exceptions specified |
| 3552 | be reentrant. | 3532 | in <var>except</var>. |
| 3553 | </p> | 3533 | </p> |
| 3534 | <br> | ||
| 3535 | <p><strong>Returns</strong><br> | ||
| 3536 | If the <var>except</var> argument is zero or all requested exceptions were | ||
| 3537 | successfully cleared, this method returns zero. Otherwise, a non-zero | ||
| 3538 | value is returned. | ||
| 3539 | </p> | ||
| 3540 | <br> | ||
| 3541 | <p><strong>Portability</strong><br> | ||
| 3542 | ANSI C requires <code>feclearexcept</code>. | ||
| 3543 | </p> | ||
| 3544 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3545 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3546 | </p> | ||
| 3547 | <br> | ||
| 3548 | <hr> | ||
| 3549 | </div> | ||
| 3550 | <div class="section" id="fegetenv"> | ||
| 3551 | <div class="header"> | ||
| 3552 | <p> | ||
| 3553 | Next: <a href="#fegetexceptflag" accesskey="n" rel="next"><code>fegetexceptflag</code>—get floating-point status flags</a>, Previous: <a href="#feclearexcept" accesskey="p" rel="prev"><code>feclearexcept</code>—clear floating-point exception</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3554 | </div> | ||
| 3555 | <span id="fegetenv_002d_002d_002dget-current-floating_002dpoint-environment"></span><h3 class="section">3.2 <code>fegetenv</code>—get current floating-point environment</h3> | ||
| 3556 | <span id="index-fegetenv"></span> | ||
| 3557 | <p><strong>Synopsis</strong> | ||
| 3558 | </p><div class="example"> | ||
| 3559 | <pre class="example">#include <fenv.h> | ||
| 3560 | int fegetenv(fenv_t *<var>envp</var>); | ||
| 3561 | |||
| 3562 | Link with -lm. | ||
| 3563 | |||
| 3564 | </pre></div> | ||
| 3565 | <p><strong>Description</strong><br> | ||
| 3566 | This method attempts to return the floating-point environment | ||
| 3567 | in the area specified by <var>envp</var>. | ||
| 3568 | </p> | ||
| 3569 | <br> | ||
| 3570 | <p><strong>Returns</strong><br> | ||
| 3571 | If floating-point environment was successfully returned, then | ||
| 3572 | this method returns zero. Otherwise, a non-zero value is returned. | ||
| 3573 | </p> | ||
| 3574 | <br> | ||
| 3575 | <p><strong>Portability</strong><br> | ||
| 3576 | ANSI C requires <code>fegetenv</code>. | ||
| 3577 | </p> | ||
| 3578 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3579 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3580 | </p> | ||
| 3581 | <br> | ||
| 3582 | <hr> | ||
| 3583 | </div> | ||
| 3584 | <div class="section" id="fegetexceptflag"> | ||
| 3585 | <div class="header"> | ||
| 3586 | <p> | ||
| 3587 | Next: <a href="#fegetround" accesskey="n" rel="next"><code>fegetround</code>—get current rounding direction</a>, Previous: <a href="#fegetenv" accesskey="p" rel="prev"><code>fegetenv</code>—get current floating-point environment</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3588 | </div> | ||
| 3589 | <span id="fegetexceptflag_002d_002d_002dget-floating_002dpoint-status-flags"></span><h3 class="section">3.3 <code>fegetexceptflag</code>—get floating-point status flags</h3> | ||
| 3590 | <span id="index-fegetexceptflag"></span> | ||
| 3591 | <p><strong>Synopsis</strong> | ||
| 3592 | </p><div class="example"> | ||
| 3593 | <pre class="example">#include <fenv.h> | ||
| 3594 | int fegetexceptflag(fexcept_t *<var>flagp</var>, int <var>excepts</var>); | ||
| 3595 | |||
| 3596 | Link with -lm. | ||
| 3597 | |||
| 3598 | </pre></div> | ||
| 3599 | <p><strong>Description</strong><br> | ||
| 3600 | This method attempts to store an implementation-defined representation | ||
| 3601 | of the states of the floating-point status flags specified by <var>excepts</var> | ||
| 3602 | in the memory pointed to by <var>flagp</var>. | ||
| 3603 | </p> | ||
| 3604 | <br> | ||
| 3605 | <p><strong>Returns</strong><br> | ||
| 3606 | If the information was successfully returned, this method returns | ||
| 3607 | zero. Otherwise, a non-zero value is returned. | ||
| 3608 | </p> | ||
| 3609 | <br> | ||
| 3610 | <p><strong>Portability</strong><br> | ||
| 3611 | ANSI C requires <code>fegetexceptflag</code>. | ||
| 3612 | </p> | ||
| 3613 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3614 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3615 | </p> | ||
| 3616 | <br> | ||
| 3617 | <hr> | ||
| 3618 | </div> | ||
| 3619 | <div class="section" id="fegetround"> | ||
| 3620 | <div class="header"> | ||
| 3621 | <p> | ||
| 3622 | Next: <a href="#feholdexcept" accesskey="n" rel="next"><code>feholdexcept</code>—save current floating-point environment</a>, Previous: <a href="#fegetexceptflag" accesskey="p" rel="prev"><code>fegetexceptflag</code>—get floating-point status flags</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3623 | </div> | ||
| 3624 | <span id="fegetround_002d_002d_002dget-current-rounding-direction"></span><h3 class="section">3.4 <code>fegetround</code>—get current rounding direction</h3> | ||
| 3625 | <span id="index-fegetround"></span> | ||
| 3626 | <p><strong>Synopsis</strong> | ||
| 3627 | </p><div class="example"> | ||
| 3628 | <pre class="example">#include <fenv.h> | ||
| 3629 | int fegetround(void); | ||
| 3630 | |||
| 3631 | Link with -lm. | ||
| 3632 | |||
| 3633 | </pre></div> | ||
| 3634 | <p><strong>Description</strong><br> | ||
| 3635 | This method returns the current rounding direction. | ||
| 3636 | </p> | ||
| 3637 | <br> | ||
| 3638 | <p><strong>Returns</strong><br> | ||
| 3639 | This method returns the rounding direction, corresponding to the value | ||
| 3640 | of the respective rouding macro. If the current rounding direction cannot | ||
| 3641 | be determined, then a negative value is returned. | ||
| 3642 | </p> | ||
| 3643 | <br> | ||
| 3644 | <p><strong>Portability</strong><br> | ||
| 3645 | ANSI C requires <code>fegetround</code>. | ||
| 3646 | </p> | ||
| 3647 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3648 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3649 | </p> | ||
| 3650 | <br> | ||
| 3651 | <hr> | ||
| 3652 | </div> | ||
| 3653 | <div class="section" id="feholdexcept"> | ||
| 3654 | <div class="header"> | ||
| 3655 | <p> | ||
| 3656 | Next: <a href="#feraiseexcept" accesskey="n" rel="next"><code>feraiseexcept</code>—raise floating-point exception</a>, Previous: <a href="#fegetround" accesskey="p" rel="prev"><code>fegetround</code>—get current rounding direction</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3657 | </div> | ||
| 3658 | <span id="feholdexcept_002d_002d_002dsave-current-floating_002dpoint-environment"></span><h3 class="section">3.5 <code>feholdexcept</code>—save current floating-point environment</h3> | ||
| 3659 | <span id="index-feholdexcept"></span> | ||
| 3660 | <p><strong>Synopsis</strong> | ||
| 3661 | </p><div class="example"> | ||
| 3662 | <pre class="example">#include <fenv.h> | ||
| 3663 | int feholdexcept(fenv_t *<var>envp</var>); | ||
| 3664 | |||
| 3665 | Link with -lm. | ||
| 3666 | |||
| 3667 | </pre></div> | ||
| 3668 | <p><strong>Description</strong><br> | ||
| 3669 | This method attempts to save the current floating-point environment | ||
| 3670 | in the fenv_t instance pointed to by <var>envp</var>, clear the floating | ||
| 3671 | point status flags, and then, if supported by the target architecture, | ||
| 3672 | install a "non-stop" (e.g. continue on floating point exceptions) mode | ||
| 3673 | for all floating-point exceptions. | ||
| 3674 | </p> | ||
| 3675 | <br> | ||
| 3676 | <p><strong>Returns</strong><br> | ||
| 3677 | This method will return zero if the non-stop floating-point exception | ||
| 3678 | handler was installed. Otherwise, a non-zero value is returned. | ||
| 3679 | </p> | ||
| 3680 | <br> | ||
| 3681 | <p><strong>Portability</strong><br> | ||
| 3682 | ANSI C requires <code>feholdexcept</code>. | ||
| 3683 | </p> | ||
| 3684 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3685 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3686 | </p> | ||
| 3687 | <br> | ||
| 3688 | <hr> | ||
| 3689 | </div> | ||
| 3690 | <div class="section" id="feraiseexcept"> | ||
| 3691 | <div class="header"> | ||
| 3692 | <p> | ||
| 3693 | Next: <a href="#fesetenv" accesskey="n" rel="next"><code>fesetenv</code>—set current floating-point environment</a>, Previous: <a href="#feholdexcept" accesskey="p" rel="prev"><code>feholdexcept</code>—save current floating-point environment</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3694 | </div> | ||
| 3695 | <span id="feraiseexcept_002d_002d_002draise-floating_002dpoint-exception"></span><h3 class="section">3.6 <code>feraiseexcept</code>—raise floating-point exception</h3> | ||
| 3696 | <span id="index-feraiseexcept"></span> | ||
| 3697 | <p><strong>Synopsis</strong> | ||
| 3698 | </p><div class="example"> | ||
| 3699 | <pre class="example">#include <fenv.h> | ||
| 3700 | int feraiseexcept(int <var>excepts</var>); | ||
| 3701 | |||
| 3702 | Link with -lm. | ||
| 3703 | |||
| 3704 | </pre></div> | ||
| 3705 | <p><strong>Description</strong><br> | ||
| 3706 | This method attempts to raise the floating-point exceptions specified | ||
| 3707 | in <var>excepts</var>. | ||
| 3708 | </p> | ||
| 3709 | <br> | ||
| 3710 | <p><strong>Returns</strong><br> | ||
| 3711 | If the <var>excepts</var> argument is zero or all requested exceptions were | ||
| 3712 | successfully raised, this method returns zero. Otherwise, a non-zero | ||
| 3713 | value is returned. | ||
| 3714 | </p> | ||
| 3715 | <br> | ||
| 3716 | <p><strong>Portability</strong><br> | ||
| 3717 | ANSI C requires <code>feraiseexcept</code>. | ||
| 3718 | </p> | ||
| 3719 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3720 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3721 | </p> | ||
| 3722 | <br> | ||
| 3723 | <hr> | ||
| 3724 | </div> | ||
| 3725 | <div class="section" id="fesetenv"> | ||
| 3726 | <div class="header"> | ||
| 3727 | <p> | ||
| 3728 | Next: <a href="#fesetexceptflag" accesskey="n" rel="next"><code>fesetexceptflag</code>—set floating-point status flags</a>, Previous: <a href="#feraiseexcept" accesskey="p" rel="prev"><code>feraiseexcept</code>—raise floating-point exception</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3729 | </div> | ||
| 3730 | <span id="fesetenv_002d_002d_002dset-current-floating_002dpoint-environment"></span><h3 class="section">3.7 <code>fesetenv</code>—set current floating-point environment</h3> | ||
| 3731 | <span id="index-fesetenv"></span> | ||
| 3732 | <p><strong>Synopsis</strong> | ||
| 3733 | </p><div class="example"> | ||
| 3734 | <pre class="example">#include <fenv.h> | ||
| 3735 | int fesetenv(const fenv_t *<var>envp</var>); | ||
| 3736 | |||
| 3737 | Link with -lm. | ||
| 3738 | |||
| 3739 | </pre></div> | ||
| 3740 | <p><strong>Description</strong><br> | ||
| 3741 | This method attempts to establish the floating-point environment | ||
| 3742 | pointed to by <var>envp</var>. The argument <var>envp</var> must point to a | ||
| 3743 | floating-point environment obtained via <code>fegetenv</code> or <code>feholdexcept</code> | ||
| 3744 | or a floating-point environment macro such as <code>FE_DFL_ENV</code>. | ||
| 3745 | </p> | ||
| 3746 | <p>It only sets the states of the flags as recorded in its argument, and | ||
| 3747 | does not actually raise the associated floating-point exceptions. | ||
| 3748 | </p> | ||
| 3749 | <br> | ||
| 3750 | <p><strong>Returns</strong><br> | ||
| 3751 | If floating-point environment was successfully established, then | ||
| 3752 | this method returns zero. Otherwise, a non-zero value is returned. | ||
| 3753 | </p> | ||
| 3754 | <br> | ||
| 3755 | <p><strong>Portability</strong><br> | ||
| 3756 | ANSI C requires <code>fesetenv</code>. | ||
| 3757 | </p> | ||
| 3758 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3759 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3760 | </p> | ||
| 3761 | <br> | ||
| 3762 | <hr> | ||
| 3763 | </div> | ||
| 3764 | <div class="section" id="fesetexceptflag"> | ||
| 3765 | <div class="header"> | ||
| 3766 | <p> | ||
| 3767 | Next: <a href="#fesetround" accesskey="n" rel="next"><code>fesetround</code>—set current rounding direction</a>, Previous: <a href="#fesetenv" accesskey="p" rel="prev"><code>fesetenv</code>—set current floating-point environment</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3768 | </div> | ||
| 3769 | <span id="fesetexceptflag_002d_002d_002dset-floating_002dpoint-status-flags"></span><h3 class="section">3.8 <code>fesetexceptflag</code>—set floating-point status flags</h3> | ||
| 3770 | <span id="index-fesetexceptflag"></span> | ||
| 3771 | <p><strong>Synopsis</strong> | ||
| 3772 | </p><div class="example"> | ||
| 3773 | <pre class="example">#include <fenv.h> | ||
| 3774 | int fesetexceptflag(const fexcept_t *<var>flagp</var>, int <var>excepts</var>); | ||
| 3775 | |||
| 3776 | Link with -lm. | ||
| 3777 | |||
| 3778 | </pre></div> | ||
| 3779 | <p><strong>Description</strong><br> | ||
| 3780 | This method attempts to set the floating-point status flags specified | ||
| 3781 | by <var>excepts</var> to the states indicated by <var>flagp</var>. The argument | ||
| 3782 | <var>flagp</var> must point to an fexcept_t instance obtained via calling | ||
| 3783 | <code>fegetexceptflag</code> with at least the floating-point exceptions specified | ||
| 3784 | by the argument <var>excepts</var>. | ||
| 3785 | </p> | ||
| 3786 | <p>This method does not raise any floating-point exceptions. It only | ||
| 3787 | sets the state of the flags. | ||
| 3788 | </p> | ||
| 3789 | <br> | ||
| 3790 | <p><strong>Returns</strong><br> | ||
| 3791 | If the information was successfully returned, this method returns | ||
| 3792 | zero. Otherwise, a non-zero value is returned. | ||
| 3793 | </p> | ||
| 3794 | <br> | ||
| 3795 | <p><strong>Portability</strong><br> | ||
| 3796 | ANSI C requires <code>fesetexceptflag</code>. | ||
| 3797 | </p> | ||
| 3798 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3799 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3800 | </p> | ||
| 3801 | <br> | ||
| 3802 | <hr> | ||
| 3803 | </div> | ||
| 3804 | <div class="section" id="fesetround"> | ||
| 3805 | <div class="header"> | ||
| 3806 | <p> | ||
| 3807 | Next: <a href="#fetestexcept" accesskey="n" rel="next"><code>fetestexcept</code>—test floating-point exception flags</a>, Previous: <a href="#fesetexceptflag" accesskey="p" rel="prev"><code>fesetexceptflag</code>—set floating-point status flags</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3808 | </div> | ||
| 3809 | <span id="fesetround_002d_002d_002dset-current-rounding-direction"></span><h3 class="section">3.9 <code>fesetround</code>—set current rounding direction</h3> | ||
| 3810 | <span id="index-fesetround"></span> | ||
| 3811 | <p><strong>Synopsis</strong> | ||
| 3812 | </p><div class="example"> | ||
| 3813 | <pre class="example">#include <fenv.h> | ||
| 3814 | int fesetround(int <var>round</var>); | ||
| 3815 | |||
| 3816 | Link with -lm. | ||
| 3817 | |||
| 3818 | </pre></div> | ||
| 3819 | <p><strong>Description</strong><br> | ||
| 3820 | This method attempts to set the current rounding direction represented | ||
| 3821 | by <var>round</var>. <var>round</var> must be the value of one of the | ||
| 3822 | rounding-direction macros. | ||
| 3823 | </p> | ||
| 3824 | <br> | ||
| 3825 | <p><strong>Returns</strong><br> | ||
| 3826 | If the rounding mode was successfully established, this method returns | ||
| 3827 | zero. Otherwise, a non-zero value is returned. | ||
| 3828 | </p> | ||
| 3829 | <br> | ||
| 3830 | <p><strong>Portability</strong><br> | ||
| 3831 | ANSI C requires <code>fesetround</code>. | ||
| 3832 | </p> | ||
| 3833 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3834 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3835 | </p> | ||
| 3836 | <br> | ||
| 3837 | <hr> | ||
| 3838 | </div> | ||
| 3839 | <div class="section" id="fetestexcept"> | ||
| 3840 | <div class="header"> | ||
| 3841 | <p> | ||
| 3842 | Next: <a href="#feupdateenv" accesskey="n" rel="next"><code>feupdateenv</code>—update current floating-point environment</a>, Previous: <a href="#fesetround" accesskey="p" rel="prev"><code>fesetround</code>—set current rounding direction</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3843 | </div> | ||
| 3844 | <span id="fetestexcept_002d_002d_002dtest-floating_002dpoint-exception-flags"></span><h3 class="section">3.10 <code>fetestexcept</code>—test floating-point exception flags</h3> | ||
| 3845 | <span id="index-fetestexcept"></span> | ||
| 3846 | <p><strong>Synopsis</strong> | ||
| 3847 | </p><div class="example"> | ||
| 3848 | <pre class="example">#include <fenv.h> | ||
| 3849 | int fetestexcept(int <var>except</var>); | ||
| 3850 | |||
| 3851 | Link with -lm. | ||
| 3554 | 3852 | ||
| 3555 | <p>With reentrant C libraries like the Red Hat newlib C library, <code>errno</code> is | 3853 | </pre></div> |
| 3556 | a macro which expands to the per-thread error value. This makes it thread | 3854 | <p><strong>Description</strong><br> |
| 3557 | safe. | 3855 | This method test the current floating-point exceptions to determine |
| 3856 | which of those specified in <var>except</var> are currently set. | ||
| 3857 | </p> | ||
| 3858 | <br> | ||
| 3859 | <p><strong>Returns</strong><br> | ||
| 3860 | This method returns the bitwise-inclusive OR of the floating point | ||
| 3861 | exception macros which correspond to the currently set floating point | ||
| 3862 | exceptions. | ||
| 3558 | </p> | 3863 | </p> |
| 3559 | <p>When the user provides his own <code>matherr</code> function it must be | 3864 | <br> |
| 3560 | reentrant for the math library as a whole to be reentrant. | 3865 | <p><strong>Portability</strong><br> |
| 3866 | ANSI C requires <code>fetestexcept</code>. | ||
| 3867 | </p> | ||
| 3868 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3869 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3870 | </p> | ||
| 3871 | <br> | ||
| 3872 | <hr> | ||
| 3873 | </div> | ||
| 3874 | <div class="section" id="feupdateenv"> | ||
| 3875 | <div class="header"> | ||
| 3876 | <p> | ||
| 3877 | Previous: <a href="#fetestexcept" accesskey="p" rel="prev"><code>fetestexcept</code>—test floating-point exception flags</a>, Up: <a href="#Fenv" accesskey="u" rel="up">Floating-Point Environment (<samp>fenv.h</samp>)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3878 | </div> | ||
| 3879 | <span id="feupdateenv_002d_002d_002dupdate-current-floating_002dpoint-environment"></span><h3 class="section">3.11 <code>feupdateenv</code>—update current floating-point environment</h3> | ||
| 3880 | <span id="index-feupdateenv"></span> | ||
| 3881 | <p><strong>Synopsis</strong> | ||
| 3882 | </p><div class="example"> | ||
| 3883 | <pre class="example">#include <fenv.h> | ||
| 3884 | int feupdateenv(const fenv_t *<var>envp</var>); | ||
| 3885 | |||
| 3886 | Link with -lm. | ||
| 3887 | |||
| 3888 | </pre></div> | ||
| 3889 | <p><strong>Description</strong><br> | ||
| 3890 | This method attempts to save the currently raised floating point | ||
| 3891 | exceptions in its automatic storage, install the floating point | ||
| 3892 | environment specified by <var>envp</var>, and raise the saved floating | ||
| 3893 | point exceptions. | ||
| 3894 | </p> | ||
| 3895 | <p>The argument <var>envp</var> must point to a floating-point environment | ||
| 3896 | obtained via <code>fegetenv</code> or <code>feholdexcept</code>. | ||
| 3897 | </p> | ||
| 3898 | <br> | ||
| 3899 | <p><strong>Returns</strong><br> | ||
| 3900 | If all actions are completed successfully, then this method returns zero. | ||
| 3901 | Otherwise, a non-zero value is returned. | ||
| 3902 | </p> | ||
| 3903 | <br> | ||
| 3904 | <p><strong>Portability</strong><br> | ||
| 3905 | ANSI C requires <code>feupdateenv</code>. | ||
| 3906 | </p> | ||
| 3907 | <p>Not all Newlib targets have a working implementation. Refer to | ||
| 3908 | the file <code>sys/fenv.h</code> to see the status for your target. | ||
| 3909 | </p> | ||
| 3910 | <br> | ||
| 3911 | |||
| 3912 | <hr> | ||
| 3913 | </div> | ||
| 3914 | </div> | ||
| 3915 | <div class="chapter" id="Reentrancy"> | ||
| 3916 | <div class="header"> | ||
| 3917 | <p> | ||
| 3918 | Next: <a href="#Long-Double-Functions" accesskey="n" rel="next">The long double function support of <code>libm</code></a>, Previous: <a href="#Fenv" accesskey="p" rel="prev">Floating-Point Environment (<samp>fenv.h</samp>)</a>, Up: <a href="#Top" accesskey="u" rel="up">LIBM</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | ||
| 3919 | </div> | ||
| 3920 | <span id="Reentrancy-Properties-of-libm"></span><h2 class="chapter">4 Reentrancy Properties of <code>libm</code></h2> | ||
| 3921 | |||
| 3922 | <span id="index-reentrancy"></span> | ||
| 3923 | <span id="index-matherr-and-reentrancy"></span> | ||
| 3924 | <p>When a libm function detects an exceptional case, <code>errno</code> may be | ||
| 3925 | set. | ||
| 3561 | </p> | 3926 | </p> |
| 3562 | <p>In normal debugged programs, there are usually no math subroutine | 3927 | |
| 3563 | errors—and therefore no assignments to <code>errno</code> and no <code>matherr</code> | 3928 | <p><code>errno</code> is a macro which expands to the per-thread error value. |
| 3564 | calls; in that situation, the math functions behave reentrantly. | 3929 | This makes it thread safe, and therefore reentrant. |
| 3565 | </p> | 3930 | </p> |
| 3566 | <hr> | 3931 | <hr> |
| 3567 | <a name="Long-Double-Functions"></a> | 3932 | </div> |
| 3933 | <div class="chapter" id="Long-Double-Functions"> | ||
| 3568 | <div class="header"> | 3934 | <div class="header"> |
| 3569 | <p> | 3935 | <p> |
| 3570 | Next: <a href="#Document-Index" accesskey="n" rel="next">Document Index</a>, Previous: <a href="#Reentrancy" accesskey="p" rel="previous">Reentrancy</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3936 | Next: <a href="#Document-Index" accesskey="n" rel="next">Document Index</a>, Previous: <a href="#Reentrancy" accesskey="p" rel="prev">Reentrancy Properties of <code>libm</code></a>, Up: <a href="#Top" accesskey="u" rel="up">LIBM</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3571 | </div> | 3937 | </div> |
| 3572 | <a name="The-long-double-function-support-of-libm"></a> | 3938 | <span id="The-long-double-function-support-of-libm"></span><h2 class="chapter">5 The long double function support of <code>libm</code></h2> |
| 3573 | <h2 class="chapter">4 The long double function support of <code>libm</code></h2> | ||
| 3574 | <p>Currently, the full set of long double math functions is only provided | 3939 | <p>Currently, the full set of long double math functions is only provided |
| 3575 | on platforms where long double equals double. | 3940 | on platforms where long double equals double. |
| 3576 | For such platforms, the long double math functions are implemented as calls to the double versions. | 3941 | For such platforms, the long double math functions are implemented as calls to the double versions. |
| 3577 | </p><hr> | 3942 | </p><hr> |
| 3578 | <a name="Document-Index"></a> | 3943 | </div> |
| 3944 | <div class="unnumbered" id="Document-Index"> | ||
| 3579 | <div class="header"> | 3945 | <div class="header"> |
| 3580 | <p> | 3946 | <p> |
| 3581 | Previous: <a href="#Long-Double-Functions" accesskey="p" rel="previous">Long Double Functions</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> | 3947 | Previous: <a href="#Long-Double-Functions" accesskey="p" rel="prev">The long double function support of <code>libm</code></a>, Up: <a href="#Top" accesskey="u" rel="up">LIBM</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Document-Index" title="Index" rel="index">Index</a>]</p> |
| 3582 | </div> | 3948 | </div> |
| 3583 | <a name="Document-Index-1"></a> | 3949 | <span id="Document-Index-1"></span><h2 class="unnumbered">Document Index</h2> |
| 3584 | <h2 class="unnumbered">Document Index</h2> | 3950 | <table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Document-Index_cp_letter-M"><b>M</b></a> |
| 3585 | <table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Document-Index_cp_letter-A"><b>A</b></a> | ||
| 3586 | | ||
| 3587 | <a class="summary-letter" href="#Document-Index_cp_letter-C"><b>C</b></a> | ||
| 3588 | | ||
| 3589 | <a class="summary-letter" href="#Document-Index_cp_letter-E"><b>E</b></a> | ||
| 3590 | | ||
| 3591 | <a class="summary-letter" href="#Document-Index_cp_letter-F"><b>F</b></a> | ||
| 3592 | | ||
| 3593 | <a class="summary-letter" href="#Document-Index_cp_letter-G"><b>G</b></a> | ||
| 3594 | | ||
| 3595 | <a class="summary-letter" href="#Document-Index_cp_letter-H"><b>H</b></a> | ||
| 3596 | | ||
| 3597 | <a class="summary-letter" href="#Document-Index_cp_letter-I"><b>I</b></a> | ||
| 3598 | | ||
| 3599 | <a class="summary-letter" href="#Document-Index_cp_letter-J"><b>J</b></a> | ||
| 3600 | | ||
| 3601 | <a class="summary-letter" href="#Document-Index_cp_letter-L"><b>L</b></a> | ||
| 3602 | | ||
| 3603 | <a class="summary-letter" href="#Document-Index_cp_letter-M"><b>M</b></a> | ||
| 3604 | | ||
| 3605 | <a class="summary-letter" href="#Document-Index_cp_letter-N"><b>N</b></a> | ||
| 3606 | | ||
| 3607 | <a class="summary-letter" href="#Document-Index_cp_letter-O"><b>O</b></a> | ||
| 3608 | | ||
| 3609 | <a class="summary-letter" href="#Document-Index_cp_letter-P"><b>P</b></a> | ||
| 3610 | | 3951 | |
| 3611 | <a class="summary-letter" href="#Document-Index_cp_letter-R"><b>R</b></a> | 3952 | <a class="summary-letter" href="#Document-Index_cp_letter-R"><b>R</b></a> |
| 3612 | | 3953 | |
| 3613 | <a class="summary-letter" href="#Document-Index_cp_letter-S"><b>S</b></a> | ||
| 3614 | | ||
| 3615 | <a class="summary-letter" href="#Document-Index_cp_letter-T"><b>T</b></a> | ||
| 3616 | | ||
| 3617 | <a class="summary-letter" href="#Document-Index_cp_letter-Y"><b>Y</b></a> | ||
| 3618 | | ||
| 3619 | </td></tr></table> | 3954 | </td></tr></table> |
| 3620 | <table class="index-cp" border="0"> | 3955 | <table class="index-cp" border="0"> |
| 3621 | <tr><td></td><th align="left">Index Entry</th><td> </td><th align="left"> Section</th></tr> | 3956 | <tr><td></td><th align="left">Index Entry</th><td> </td><th align="left"> Section</th></tr> |
| 3622 | <tr><td colspan="4"> <hr></td></tr> | 3957 | <tr><td colspan="4"> <hr></td></tr> |
| 3623 | <tr><th><a name="Document-Index_cp_letter-A">A</a></th><td></td><td></td></tr> | 3958 | <tr><th id="Document-Index_cp_letter-M">M</th><td></td><td></td></tr> |
| 3624 | <tr><td></td><td valign="top"><a href="#index-acos"><code>acos</code></a>:</td><td> </td><td valign="top"><a href="#acos">acos</a></td></tr> | ||
| 3625 | <tr><td></td><td valign="top"><a href="#index-acosf"><code>acosf</code></a>:</td><td> </td><td valign="top"><a href="#acos">acos</a></td></tr> | ||
| 3626 | <tr><td></td><td valign="top"><a href="#index-acosh"><code>acosh</code></a>:</td><td> </td><td valign="top"><a href="#acosh">acosh</a></td></tr> | ||
| 3627 | <tr><td></td><td valign="top"><a href="#index-acoshf"><code>acoshf</code></a>:</td><td> </td><td valign="top"><a href="#acosh">acosh</a></td></tr> | ||
| 3628 | <tr><td></td><td valign="top"><a href="#index-asin"><code>asin</code></a>:</td><td> </td><td valign="top"><a href="#asin">asin</a></td></tr> | ||
| 3629 | <tr><td></td><td valign="top"><a href="#index-asinf"><code>asinf</code></a>:</td><td> </td><td valign="top"><a href="#asin">asin</a></td></tr> | ||
| 3630 | <tr><td></td><td valign="top"><a href="#index-asinh"><code>asinh</code></a>:</td><td> </td><td valign="top"><a href="#asinh">asinh</a></td></tr> | ||
| 3631 | <tr><td></td><td valign="top"><a href="#index-asinhf"><code>asinhf</code></a>:</td><td> </td><td valign="top"><a href="#asinh">asinh</a></td></tr> | ||
| 3632 | <tr><td></td><td valign="top"><a href="#index-atan"><code>atan</code></a>:</td><td> </td><td valign="top"><a href="#atan">atan</a></td></tr> | ||
| 3633 | <tr><td></td><td valign="top"><a href="#index-atan2"><code>atan2</code></a>:</td><td> </td><td valign="top"><a href="#atan2">atan2</a></td></tr> | ||
| 3634 | <tr><td></td><td valign="top"><a href="#index-atan2f"><code>atan2f</code></a>:</td><td> </td><td valign="top"><a href="#atan2">atan2</a></td></tr> | ||
| 3635 | <tr><td></td><td valign="top"><a href="#index-atanf"><code>atanf</code></a>:</td><td> </td><td valign="top"><a href="#atan">atan</a></td></tr> | ||
| 3636 | <tr><td></td><td valign="top"><a href="#index-atanh"><code>atanh</code></a>:</td><td> </td><td valign="top"><a href="#atanh">atanh</a></td></tr> | ||
| 3637 | <tr><td></td><td valign="top"><a href="#index-atanhf"><code>atanhf</code></a>:</td><td> </td><td valign="top"><a href="#atanh">atanh</a></td></tr> | ||
| 3638 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3639 | <tr><th><a name="Document-Index_cp_letter-C">C</a></th><td></td><td></td></tr> | ||
| 3640 | <tr><td></td><td valign="top"><a href="#index-cabs"><code>cabs</code></a>:</td><td> </td><td valign="top"><a href="#cabs">cabs</a></td></tr> | ||
| 3641 | <tr><td></td><td valign="top"><a href="#index-cabsf"><code>cabsf</code></a>:</td><td> </td><td valign="top"><a href="#cabs">cabs</a></td></tr> | ||
| 3642 | <tr><td></td><td valign="top"><a href="#index-cacos"><code>cacos</code></a>:</td><td> </td><td valign="top"><a href="#cacos">cacos</a></td></tr> | ||
| 3643 | <tr><td></td><td valign="top"><a href="#index-cacosf"><code>cacosf</code></a>:</td><td> </td><td valign="top"><a href="#cacos">cacos</a></td></tr> | ||
| 3644 | <tr><td></td><td valign="top"><a href="#index-cacosh"><code>cacosh</code></a>:</td><td> </td><td valign="top"><a href="#cacosh">cacosh</a></td></tr> | ||
| 3645 | <tr><td></td><td valign="top"><a href="#index-cacoshf"><code>cacoshf</code></a>:</td><td> </td><td valign="top"><a href="#cacosh">cacosh</a></td></tr> | ||
| 3646 | <tr><td></td><td valign="top"><a href="#index-carg"><code>carg</code></a>:</td><td> </td><td valign="top"><a href="#carg">carg</a></td></tr> | ||
| 3647 | <tr><td></td><td valign="top"><a href="#index-cargf"><code>cargf</code></a>:</td><td> </td><td valign="top"><a href="#carg">carg</a></td></tr> | ||
| 3648 | <tr><td></td><td valign="top"><a href="#index-casin"><code>casin</code></a>:</td><td> </td><td valign="top"><a href="#casin">casin</a></td></tr> | ||
| 3649 | <tr><td></td><td valign="top"><a href="#index-casinf"><code>casinf</code></a>:</td><td> </td><td valign="top"><a href="#casin">casin</a></td></tr> | ||
| 3650 | <tr><td></td><td valign="top"><a href="#index-casinh"><code>casinh</code></a>:</td><td> </td><td valign="top"><a href="#casinh">casinh</a></td></tr> | ||
| 3651 | <tr><td></td><td valign="top"><a href="#index-casinhf"><code>casinhf</code></a>:</td><td> </td><td valign="top"><a href="#casinh">casinh</a></td></tr> | ||
| 3652 | <tr><td></td><td valign="top"><a href="#index-catan"><code>catan</code></a>:</td><td> </td><td valign="top"><a href="#catan">catan</a></td></tr> | ||
| 3653 | <tr><td></td><td valign="top"><a href="#index-catanf"><code>catanf</code></a>:</td><td> </td><td valign="top"><a href="#catan">catan</a></td></tr> | ||
| 3654 | <tr><td></td><td valign="top"><a href="#index-catanh"><code>catanh</code></a>:</td><td> </td><td valign="top"><a href="#catanh">catanh</a></td></tr> | ||
| 3655 | <tr><td></td><td valign="top"><a href="#index-catanhf"><code>catanhf</code></a>:</td><td> </td><td valign="top"><a href="#catanh">catanh</a></td></tr> | ||
| 3656 | <tr><td></td><td valign="top"><a href="#index-cbrt"><code>cbrt</code></a>:</td><td> </td><td valign="top"><a href="#cbrt">cbrt</a></td></tr> | ||
| 3657 | <tr><td></td><td valign="top"><a href="#index-cbrtf"><code>cbrtf</code></a>:</td><td> </td><td valign="top"><a href="#cbrt">cbrt</a></td></tr> | ||
| 3658 | <tr><td></td><td valign="top"><a href="#index-ccos"><code>ccos</code></a>:</td><td> </td><td valign="top"><a href="#ccos">ccos</a></td></tr> | ||
| 3659 | <tr><td></td><td valign="top"><a href="#index-ccosf"><code>ccosf</code></a>:</td><td> </td><td valign="top"><a href="#ccos">ccos</a></td></tr> | ||
| 3660 | <tr><td></td><td valign="top"><a href="#index-ccosh"><code>ccosh</code></a>:</td><td> </td><td valign="top"><a href="#ccosh">ccosh</a></td></tr> | ||
| 3661 | <tr><td></td><td valign="top"><a href="#index-ccoshf"><code>ccoshf</code></a>:</td><td> </td><td valign="top"><a href="#ccosh">ccosh</a></td></tr> | ||
| 3662 | <tr><td></td><td valign="top"><a href="#index-ceil"><code>ceil</code></a>:</td><td> </td><td valign="top"><a href="#floor">floor</a></td></tr> | ||
| 3663 | <tr><td></td><td valign="top"><a href="#index-ceilf"><code>ceilf</code></a>:</td><td> </td><td valign="top"><a href="#floor">floor</a></td></tr> | ||
| 3664 | <tr><td></td><td valign="top"><a href="#index-cexp"><code>cexp</code></a>:</td><td> </td><td valign="top"><a href="#cexp">cexp</a></td></tr> | ||
| 3665 | <tr><td></td><td valign="top"><a href="#index-cexpf"><code>cexpf</code></a>:</td><td> </td><td valign="top"><a href="#cexp">cexp</a></td></tr> | ||
| 3666 | <tr><td></td><td valign="top"><a href="#index-cimag"><code>cimag</code></a>:</td><td> </td><td valign="top"><a href="#cimag">cimag</a></td></tr> | ||
| 3667 | <tr><td></td><td valign="top"><a href="#index-cimagf"><code>cimagf</code></a>:</td><td> </td><td valign="top"><a href="#cimag">cimag</a></td></tr> | ||
| 3668 | <tr><td></td><td valign="top"><a href="#index-clog"><code>clog</code></a>:</td><td> </td><td valign="top"><a href="#clog">clog</a></td></tr> | ||
| 3669 | <tr><td></td><td valign="top"><a href="#index-clogf"><code>clogf</code></a>:</td><td> </td><td valign="top"><a href="#clog">clog</a></td></tr> | ||
| 3670 | <tr><td></td><td valign="top"><a href="#index-conj"><code>conj</code></a>:</td><td> </td><td valign="top"><a href="#conj">conj</a></td></tr> | ||
| 3671 | <tr><td></td><td valign="top"><a href="#index-conjf"><code>conjf</code></a>:</td><td> </td><td valign="top"><a href="#conj">conj</a></td></tr> | ||
| 3672 | <tr><td></td><td valign="top"><a href="#index-copysign"><code>copysign</code></a>:</td><td> </td><td valign="top"><a href="#copysign">copysign</a></td></tr> | ||
| 3673 | <tr><td></td><td valign="top"><a href="#index-copysignf"><code>copysignf</code></a>:</td><td> </td><td valign="top"><a href="#copysign">copysign</a></td></tr> | ||
| 3674 | <tr><td></td><td valign="top"><a href="#index-cos"><code>cos</code></a>:</td><td> </td><td valign="top"><a href="#sin">sin</a></td></tr> | ||
| 3675 | <tr><td></td><td valign="top"><a href="#index-cosf"><code>cosf</code></a>:</td><td> </td><td valign="top"><a href="#sin">sin</a></td></tr> | ||
| 3676 | <tr><td></td><td valign="top"><a href="#index-cpow"><code>cpow</code></a>:</td><td> </td><td valign="top"><a href="#cpow">cpow</a></td></tr> | ||
| 3677 | <tr><td></td><td valign="top"><a href="#index-cpowf"><code>cpowf</code></a>:</td><td> </td><td valign="top"><a href="#cpow">cpow</a></td></tr> | ||
| 3678 | <tr><td></td><td valign="top"><a href="#index-cproj"><code>cproj</code></a>:</td><td> </td><td valign="top"><a href="#cproj">cproj</a></td></tr> | ||
| 3679 | <tr><td></td><td valign="top"><a href="#index-cprojf"><code>cprojf</code></a>:</td><td> </td><td valign="top"><a href="#cproj">cproj</a></td></tr> | ||
| 3680 | <tr><td></td><td valign="top"><a href="#index-creal"><code>creal</code></a>:</td><td> </td><td valign="top"><a href="#creal">creal</a></td></tr> | ||
| 3681 | <tr><td></td><td valign="top"><a href="#index-crealf"><code>crealf</code></a>:</td><td> </td><td valign="top"><a href="#creal">creal</a></td></tr> | ||
| 3682 | <tr><td></td><td valign="top"><a href="#index-csin"><code>csin</code></a>:</td><td> </td><td valign="top"><a href="#csin">csin</a></td></tr> | ||
| 3683 | <tr><td></td><td valign="top"><a href="#index-csinf"><code>csinf</code></a>:</td><td> </td><td valign="top"><a href="#csin">csin</a></td></tr> | ||
| 3684 | <tr><td></td><td valign="top"><a href="#index-csinh"><code>csinh</code></a>:</td><td> </td><td valign="top"><a href="#csinh">csinh</a></td></tr> | ||
| 3685 | <tr><td></td><td valign="top"><a href="#index-csinhf"><code>csinhf</code></a>:</td><td> </td><td valign="top"><a href="#csinh">csinh</a></td></tr> | ||
| 3686 | <tr><td></td><td valign="top"><a href="#index-csqrt"><code>csqrt</code></a>:</td><td> </td><td valign="top"><a href="#csqrt">csqrt</a></td></tr> | ||
| 3687 | <tr><td></td><td valign="top"><a href="#index-csqrtf"><code>csqrtf</code></a>:</td><td> </td><td valign="top"><a href="#csqrt">csqrt</a></td></tr> | ||
| 3688 | <tr><td></td><td valign="top"><a href="#index-ctan"><code>ctan</code></a>:</td><td> </td><td valign="top"><a href="#ctan">ctan</a></td></tr> | ||
| 3689 | <tr><td></td><td valign="top"><a href="#index-ctanf"><code>ctanf</code></a>:</td><td> </td><td valign="top"><a href="#ctan">ctan</a></td></tr> | ||
| 3690 | <tr><td></td><td valign="top"><a href="#index-ctanh"><code>ctanh</code></a>:</td><td> </td><td valign="top"><a href="#ctanh">ctanh</a></td></tr> | ||
| 3691 | <tr><td></td><td valign="top"><a href="#index-ctanhf"><code>ctanhf</code></a>:</td><td> </td><td valign="top"><a href="#ctanh">ctanh</a></td></tr> | ||
| 3692 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3693 | <tr><th><a name="Document-Index_cp_letter-E">E</a></th><td></td><td></td></tr> | ||
| 3694 | <tr><td></td><td valign="top"><a href="#index-erf"><code>erf</code></a>:</td><td> </td><td valign="top"><a href="#erf">erf</a></td></tr> | ||
| 3695 | <tr><td></td><td valign="top"><a href="#index-erfc"><code>erfc</code></a>:</td><td> </td><td valign="top"><a href="#erf">erf</a></td></tr> | ||
| 3696 | <tr><td></td><td valign="top"><a href="#index-erfcf"><code>erfcf</code></a>:</td><td> </td><td valign="top"><a href="#erf">erf</a></td></tr> | ||
| 3697 | <tr><td></td><td valign="top"><a href="#index-erff"><code>erff</code></a>:</td><td> </td><td valign="top"><a href="#erf">erf</a></td></tr> | ||
| 3698 | <tr><td></td><td valign="top"><a href="#index-exp"><code>exp</code></a>:</td><td> </td><td valign="top"><a href="#exp">exp</a></td></tr> | ||
| 3699 | <tr><td></td><td valign="top"><a href="#index-exp2"><code>exp2</code></a>:</td><td> </td><td valign="top"><a href="#exp2">exp2</a></td></tr> | ||
| 3700 | <tr><td></td><td valign="top"><a href="#index-exp2f"><code>exp2f</code></a>:</td><td> </td><td valign="top"><a href="#exp2">exp2</a></td></tr> | ||
| 3701 | <tr><td></td><td valign="top"><a href="#index-expf"><code>expf</code></a>:</td><td> </td><td valign="top"><a href="#exp">exp</a></td></tr> | ||
| 3702 | <tr><td></td><td valign="top"><a href="#index-expm1"><code>expm1</code></a>:</td><td> </td><td valign="top"><a href="#expm1">expm1</a></td></tr> | ||
| 3703 | <tr><td></td><td valign="top"><a href="#index-expm1f"><code>expm1f</code></a>:</td><td> </td><td valign="top"><a href="#expm1">expm1</a></td></tr> | ||
| 3704 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3705 | <tr><th><a name="Document-Index_cp_letter-F">F</a></th><td></td><td></td></tr> | ||
| 3706 | <tr><td></td><td valign="top"><a href="#index-fabs"><code>fabs</code></a>:</td><td> </td><td valign="top"><a href="#fabs">fabs</a></td></tr> | ||
| 3707 | <tr><td></td><td valign="top"><a href="#index-fabsf"><code>fabsf</code></a>:</td><td> </td><td valign="top"><a href="#fabs">fabs</a></td></tr> | ||
| 3708 | <tr><td></td><td valign="top"><a href="#index-fdim"><code>fdim</code></a>:</td><td> </td><td valign="top"><a href="#fdim">fdim</a></td></tr> | ||
| 3709 | <tr><td></td><td valign="top"><a href="#index-fdimf"><code>fdimf</code></a>:</td><td> </td><td valign="top"><a href="#fdim">fdim</a></td></tr> | ||
| 3710 | <tr><td></td><td valign="top"><a href="#index-finite"><code>finite</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3711 | <tr><td></td><td valign="top"><a href="#index-finitef"><code>finitef</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3712 | <tr><td></td><td valign="top"><a href="#index-floor"><code>floor</code></a>:</td><td> </td><td valign="top"><a href="#floor">floor</a></td></tr> | ||
| 3713 | <tr><td></td><td valign="top"><a href="#index-floorf"><code>floorf</code></a>:</td><td> </td><td valign="top"><a href="#floor">floor</a></td></tr> | ||
| 3714 | <tr><td></td><td valign="top"><a href="#index-fma"><code>fma</code></a>:</td><td> </td><td valign="top"><a href="#fma">fma</a></td></tr> | ||
| 3715 | <tr><td></td><td valign="top"><a href="#index-fmaf"><code>fmaf</code></a>:</td><td> </td><td valign="top"><a href="#fma">fma</a></td></tr> | ||
| 3716 | <tr><td></td><td valign="top"><a href="#index-fmax"><code>fmax</code></a>:</td><td> </td><td valign="top"><a href="#fmax">fmax</a></td></tr> | ||
| 3717 | <tr><td></td><td valign="top"><a href="#index-fmaxf"><code>fmaxf</code></a>:</td><td> </td><td valign="top"><a href="#fmax">fmax</a></td></tr> | ||
| 3718 | <tr><td></td><td valign="top"><a href="#index-fmin"><code>fmin</code></a>:</td><td> </td><td valign="top"><a href="#fmin">fmin</a></td></tr> | ||
| 3719 | <tr><td></td><td valign="top"><a href="#index-fminf"><code>fminf</code></a>:</td><td> </td><td valign="top"><a href="#fmin">fmin</a></td></tr> | ||
| 3720 | <tr><td></td><td valign="top"><a href="#index-fmod"><code>fmod</code></a>:</td><td> </td><td valign="top"><a href="#fmod">fmod</a></td></tr> | ||
| 3721 | <tr><td></td><td valign="top"><a href="#index-fmodf"><code>fmodf</code></a>:</td><td> </td><td valign="top"><a href="#fmod">fmod</a></td></tr> | ||
| 3722 | <tr><td></td><td valign="top"><a href="#index-fpclassify"><code>fpclassify</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3723 | <tr><td></td><td valign="top"><a href="#index-frexp"><code>frexp</code></a>:</td><td> </td><td valign="top"><a href="#frexp">frexp</a></td></tr> | ||
| 3724 | <tr><td></td><td valign="top"><a href="#index-frexpf"><code>frexpf</code></a>:</td><td> </td><td valign="top"><a href="#frexp">frexp</a></td></tr> | ||
| 3725 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3726 | <tr><th><a name="Document-Index_cp_letter-G">G</a></th><td></td><td></td></tr> | ||
| 3727 | <tr><td></td><td valign="top"><a href="#index-gamma"><code>gamma</code></a>:</td><td> </td><td valign="top"><a href="#gamma">gamma</a></td></tr> | ||
| 3728 | <tr><td></td><td valign="top"><a href="#index-gammaf"><code>gammaf</code></a>:</td><td> </td><td valign="top"><a href="#gamma">gamma</a></td></tr> | ||
| 3729 | <tr><td></td><td valign="top"><a href="#index-gammaf_005fr"><code>gammaf_r</code></a>:</td><td> </td><td valign="top"><a href="#gamma">gamma</a></td></tr> | ||
| 3730 | <tr><td></td><td valign="top"><a href="#index-gamma_005fr"><code>gamma_r</code></a>:</td><td> </td><td valign="top"><a href="#gamma">gamma</a></td></tr> | ||
| 3731 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3732 | <tr><th><a name="Document-Index_cp_letter-H">H</a></th><td></td><td></td></tr> | ||
| 3733 | <tr><td></td><td valign="top"><a href="#index-hypot"><code>hypot</code></a>:</td><td> </td><td valign="top"><a href="#hypot">hypot</a></td></tr> | ||
| 3734 | <tr><td></td><td valign="top"><a href="#index-hypotf"><code>hypotf</code></a>:</td><td> </td><td valign="top"><a href="#hypot">hypot</a></td></tr> | ||
| 3735 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3736 | <tr><th><a name="Document-Index_cp_letter-I">I</a></th><td></td><td></td></tr> | ||
| 3737 | <tr><td></td><td valign="top"><a href="#index-ilogb"><code>ilogb</code></a>:</td><td> </td><td valign="top"><a href="#ilogb">ilogb</a></td></tr> | ||
| 3738 | <tr><td></td><td valign="top"><a href="#index-ilogbf"><code>ilogbf</code></a>:</td><td> </td><td valign="top"><a href="#ilogb">ilogb</a></td></tr> | ||
| 3739 | <tr><td></td><td valign="top"><a href="#index-infinity"><code>infinity</code></a>:</td><td> </td><td valign="top"><a href="#infinity">infinity</a></td></tr> | ||
| 3740 | <tr><td></td><td valign="top"><a href="#index-infinityf"><code>infinityf</code></a>:</td><td> </td><td valign="top"><a href="#infinity">infinity</a></td></tr> | ||
| 3741 | <tr><td></td><td valign="top"><a href="#index-isfinite"><code>isfinite</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3742 | <tr><td></td><td valign="top"><a href="#index-isgreater"><code>isgreater</code></a>:</td><td> </td><td valign="top"><a href="#isgreater">isgreater</a></td></tr> | ||
| 3743 | <tr><td></td><td valign="top"><a href="#index-isgreaterequal"><code>isgreaterequal</code></a>:</td><td> </td><td valign="top"><a href="#isgreater">isgreater</a></td></tr> | ||
| 3744 | <tr><td></td><td valign="top"><a href="#index-isinf"><code>isinf</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3745 | <tr><td></td><td valign="top"><a href="#index-isinf-1"><code>isinf</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3746 | <tr><td></td><td valign="top"><a href="#index-isinff"><code>isinff</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3747 | <tr><td></td><td valign="top"><a href="#index-isless"><code>isless</code></a>:</td><td> </td><td valign="top"><a href="#isgreater">isgreater</a></td></tr> | ||
| 3748 | <tr><td></td><td valign="top"><a href="#index-islessequal"><code>islessequal</code></a>:</td><td> </td><td valign="top"><a href="#isgreater">isgreater</a></td></tr> | ||
| 3749 | <tr><td></td><td valign="top"><a href="#index-islessgreater"><code>islessgreater</code></a>:</td><td> </td><td valign="top"><a href="#isgreater">isgreater</a></td></tr> | ||
| 3750 | <tr><td></td><td valign="top"><a href="#index-isnan"><code>isnan</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3751 | <tr><td></td><td valign="top"><a href="#index-isnan-1"><code>isnan</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3752 | <tr><td></td><td valign="top"><a href="#index-isnanf"><code>isnanf</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3753 | <tr><td></td><td valign="top"><a href="#index-isnormal"><code>isnormal</code></a>:</td><td> </td><td valign="top"><a href="#fpclassify">fpclassify</a></td></tr> | ||
| 3754 | <tr><td></td><td valign="top"><a href="#index-isunordered"><code>isunordered</code></a>:</td><td> </td><td valign="top"><a href="#isgreater">isgreater</a></td></tr> | ||
| 3755 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3756 | <tr><th><a name="Document-Index_cp_letter-J">J</a></th><td></td><td></td></tr> | ||
| 3757 | <tr><td></td><td valign="top"><a href="#index-j0"><code>j0</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3758 | <tr><td></td><td valign="top"><a href="#index-j0f"><code>j0f</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3759 | <tr><td></td><td valign="top"><a href="#index-j1"><code>j1</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3760 | <tr><td></td><td valign="top"><a href="#index-j1f"><code>j1f</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3761 | <tr><td></td><td valign="top"><a href="#index-jn"><code>jn</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3762 | <tr><td></td><td valign="top"><a href="#index-jnf"><code>jnf</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3763 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3764 | <tr><th><a name="Document-Index_cp_letter-L">L</a></th><td></td><td></td></tr> | ||
| 3765 | <tr><td></td><td valign="top"><a href="#index-ldexp"><code>ldexp</code></a>:</td><td> </td><td valign="top"><a href="#ldexp">ldexp</a></td></tr> | ||
| 3766 | <tr><td></td><td valign="top"><a href="#index-ldexpf"><code>ldexpf</code></a>:</td><td> </td><td valign="top"><a href="#ldexp">ldexp</a></td></tr> | ||
| 3767 | <tr><td></td><td valign="top"><a href="#index-lgamma"><code>lgamma</code></a>:</td><td> </td><td valign="top"><a href="#gamma">gamma</a></td></tr> | ||
| 3768 | <tr><td></td><td valign="top"><a href="#index-lgammaf"><code>lgammaf</code></a>:</td><td> </td><td valign="top"><a href="#gamma">gamma</a></td></tr> | ||
| 3769 | <tr><td></td><td valign="top"><a href="#index-lgammaf_005fr"><code>lgammaf_r</code></a>:</td><td> </td><td valign="top"><a href="#gamma">gamma</a></td></tr> | ||
| 3770 | <tr><td></td><td valign="top"><a href="#index-lgamma_005fr"><code>lgamma_r</code></a>:</td><td> </td><td valign="top"><a href="#gamma">gamma</a></td></tr> | ||
| 3771 | <tr><td></td><td valign="top"><a href="#index-llrint"><code>llrint</code></a>:</td><td> </td><td valign="top"><a href="#lrint">lrint</a></td></tr> | ||
| 3772 | <tr><td></td><td valign="top"><a href="#index-llrintf"><code>llrintf</code></a>:</td><td> </td><td valign="top"><a href="#lrint">lrint</a></td></tr> | ||
| 3773 | <tr><td></td><td valign="top"><a href="#index-llround"><code>llround</code></a>:</td><td> </td><td valign="top"><a href="#lround">lround</a></td></tr> | ||
| 3774 | <tr><td></td><td valign="top"><a href="#index-llroundf"><code>llroundf</code></a>:</td><td> </td><td valign="top"><a href="#lround">lround</a></td></tr> | ||
| 3775 | <tr><td></td><td valign="top"><a href="#index-log"><code>log</code></a>:</td><td> </td><td valign="top"><a href="#log">log</a></td></tr> | ||
| 3776 | <tr><td></td><td valign="top"><a href="#index-log10"><code>log10</code></a>:</td><td> </td><td valign="top"><a href="#log10">log10</a></td></tr> | ||
| 3777 | <tr><td></td><td valign="top"><a href="#index-log10f"><code>log10f</code></a>:</td><td> </td><td valign="top"><a href="#log10">log10</a></td></tr> | ||
| 3778 | <tr><td></td><td valign="top"><a href="#index-log1p"><code>log1p</code></a>:</td><td> </td><td valign="top"><a href="#log1p">log1p</a></td></tr> | ||
| 3779 | <tr><td></td><td valign="top"><a href="#index-log1pf"><code>log1pf</code></a>:</td><td> </td><td valign="top"><a href="#log1p">log1p</a></td></tr> | ||
| 3780 | <tr><td></td><td valign="top"><a href="#index-log2"><code>log2</code></a>:</td><td> </td><td valign="top"><a href="#log2">log2</a></td></tr> | ||
| 3781 | <tr><td></td><td valign="top"><a href="#index-log2f"><code>log2f</code></a>:</td><td> </td><td valign="top"><a href="#log2">log2</a></td></tr> | ||
| 3782 | <tr><td></td><td valign="top"><a href="#index-logb"><code>logb</code></a>:</td><td> </td><td valign="top"><a href="#logb">logb</a></td></tr> | ||
| 3783 | <tr><td></td><td valign="top"><a href="#index-logbf"><code>logbf</code></a>:</td><td> </td><td valign="top"><a href="#logb">logb</a></td></tr> | ||
| 3784 | <tr><td></td><td valign="top"><a href="#index-logf"><code>logf</code></a>:</td><td> </td><td valign="top"><a href="#log">log</a></td></tr> | ||
| 3785 | <tr><td></td><td valign="top"><a href="#index-lrint"><code>lrint</code></a>:</td><td> </td><td valign="top"><a href="#lrint">lrint</a></td></tr> | ||
| 3786 | <tr><td></td><td valign="top"><a href="#index-lrintf"><code>lrintf</code></a>:</td><td> </td><td valign="top"><a href="#lrint">lrint</a></td></tr> | ||
| 3787 | <tr><td></td><td valign="top"><a href="#index-lround"><code>lround</code></a>:</td><td> </td><td valign="top"><a href="#lround">lround</a></td></tr> | ||
| 3788 | <tr><td></td><td valign="top"><a href="#index-lroundf"><code>lroundf</code></a>:</td><td> </td><td valign="top"><a href="#lround">lround</a></td></tr> | ||
| 3789 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3790 | <tr><th><a name="Document-Index_cp_letter-M">M</a></th><td></td><td></td></tr> | ||
| 3791 | <tr><td></td><td valign="top"><a href="#index-matherr"><code>matherr</code></a>:</td><td> </td><td valign="top"><a href="#matherr">matherr</a></td></tr> | ||
| 3792 | <tr><td></td><td valign="top"><a href="#index-matherr-and-reentrancy"><code>matherr</code> and reentrancy</a>:</td><td> </td><td valign="top"><a href="#Reentrancy">Reentrancy</a></td></tr> | 3959 | <tr><td></td><td valign="top"><a href="#index-matherr-and-reentrancy"><code>matherr</code> and reentrancy</a>:</td><td> </td><td valign="top"><a href="#Reentrancy">Reentrancy</a></td></tr> |
| 3793 | <tr><td></td><td valign="top"><a href="#index-modf"><code>modf</code></a>:</td><td> </td><td valign="top"><a href="#modf">modf</a></td></tr> | ||
| 3794 | <tr><td></td><td valign="top"><a href="#index-modff"><code>modff</code></a>:</td><td> </td><td valign="top"><a href="#modf">modf</a></td></tr> | ||
| 3795 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3796 | <tr><th><a name="Document-Index_cp_letter-N">N</a></th><td></td><td></td></tr> | ||
| 3797 | <tr><td></td><td valign="top"><a href="#index-nan"><code>nan</code></a>:</td><td> </td><td valign="top"><a href="#nan">nan</a></td></tr> | ||
| 3798 | <tr><td></td><td valign="top"><a href="#index-nanf"><code>nanf</code></a>:</td><td> </td><td valign="top"><a href="#nan">nan</a></td></tr> | ||
| 3799 | <tr><td></td><td valign="top"><a href="#index-nearbyint"><code>nearbyint</code></a>:</td><td> </td><td valign="top"><a href="#nearbyint">nearbyint</a></td></tr> | ||
| 3800 | <tr><td></td><td valign="top"><a href="#index-nearbyintf"><code>nearbyintf</code></a>:</td><td> </td><td valign="top"><a href="#nearbyint">nearbyint</a></td></tr> | ||
| 3801 | <tr><td></td><td valign="top"><a href="#index-nextafter"><code>nextafter</code></a>:</td><td> </td><td valign="top"><a href="#nextafter">nextafter</a></td></tr> | ||
| 3802 | <tr><td></td><td valign="top"><a href="#index-nextafterf"><code>nextafterf</code></a>:</td><td> </td><td valign="top"><a href="#nextafter">nextafter</a></td></tr> | ||
| 3803 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3804 | <tr><th><a name="Document-Index_cp_letter-O">O</a></th><td></td><td></td></tr> | ||
| 3805 | <tr><td></td><td valign="top"><a href="#index-OS-stubs">OS stubs</a>:</td><td> </td><td valign="top"><a href="#Math">Math</a></td></tr> | ||
| 3806 | <tr><td colspan="4"> <hr></td></tr> | 3960 | <tr><td colspan="4"> <hr></td></tr> |
| 3807 | <tr><th><a name="Document-Index_cp_letter-P">P</a></th><td></td><td></td></tr> | 3961 | <tr><th id="Document-Index_cp_letter-R">R</th><td></td><td></td></tr> |
| 3808 | <tr><td></td><td valign="top"><a href="#index-pow"><code>pow</code></a>:</td><td> </td><td valign="top"><a href="#pow">pow</a></td></tr> | ||
| 3809 | <tr><td></td><td valign="top"><a href="#index-powf"><code>powf</code></a>:</td><td> </td><td valign="top"><a href="#pow">pow</a></td></tr> | ||
| 3810 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3811 | <tr><th><a name="Document-Index_cp_letter-R">R</a></th><td></td><td></td></tr> | ||
| 3812 | <tr><td></td><td valign="top"><a href="#index-reentrancy">reentrancy</a>:</td><td> </td><td valign="top"><a href="#Reentrancy">Reentrancy</a></td></tr> | 3962 | <tr><td></td><td valign="top"><a href="#index-reentrancy">reentrancy</a>:</td><td> </td><td valign="top"><a href="#Reentrancy">Reentrancy</a></td></tr> |
| 3813 | <tr><td></td><td valign="top"><a href="#index-remainder"><code>remainder</code></a>:</td><td> </td><td valign="top"><a href="#remainder">remainder</a></td></tr> | ||
| 3814 | <tr><td></td><td valign="top"><a href="#index-remainderf"><code>remainderf</code></a>:</td><td> </td><td valign="top"><a href="#remainder">remainder</a></td></tr> | ||
| 3815 | <tr><td></td><td valign="top"><a href="#index-remquo"><code>remquo</code></a>:</td><td> </td><td valign="top"><a href="#remquo">remquo</a></td></tr> | ||
| 3816 | <tr><td></td><td valign="top"><a href="#index-remquof"><code>remquof</code></a>:</td><td> </td><td valign="top"><a href="#remquo">remquo</a></td></tr> | ||
| 3817 | <tr><td></td><td valign="top"><a href="#index-rint"><code>rint</code></a>:</td><td> </td><td valign="top"><a href="#rint">rint</a></td></tr> | ||
| 3818 | <tr><td></td><td valign="top"><a href="#index-rintf"><code>rintf</code></a>:</td><td> </td><td valign="top"><a href="#rint">rint</a></td></tr> | ||
| 3819 | <tr><td></td><td valign="top"><a href="#index-round"><code>round</code></a>:</td><td> </td><td valign="top"><a href="#round">round</a></td></tr> | ||
| 3820 | <tr><td></td><td valign="top"><a href="#index-roundf"><code>roundf</code></a>:</td><td> </td><td valign="top"><a href="#round">round</a></td></tr> | ||
| 3821 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3822 | <tr><th><a name="Document-Index_cp_letter-S">S</a></th><td></td><td></td></tr> | ||
| 3823 | <tr><td></td><td valign="top"><a href="#index-scalbln"><code>scalbln</code></a>:</td><td> </td><td valign="top"><a href="#scalbn">scalbn</a></td></tr> | ||
| 3824 | <tr><td></td><td valign="top"><a href="#index-scalblnf"><code>scalblnf</code></a>:</td><td> </td><td valign="top"><a href="#scalbn">scalbn</a></td></tr> | ||
| 3825 | <tr><td></td><td valign="top"><a href="#index-scalbn"><code>scalbn</code></a>:</td><td> </td><td valign="top"><a href="#scalbn">scalbn</a></td></tr> | ||
| 3826 | <tr><td></td><td valign="top"><a href="#index-scalbnf"><code>scalbnf</code></a>:</td><td> </td><td valign="top"><a href="#scalbn">scalbn</a></td></tr> | ||
| 3827 | <tr><td></td><td valign="top"><a href="#index-signbit"><code>signbit</code></a>:</td><td> </td><td valign="top"><a href="#signbit">signbit</a></td></tr> | ||
| 3828 | <tr><td></td><td valign="top"><a href="#index-sin"><code>sin</code></a>:</td><td> </td><td valign="top"><a href="#sin">sin</a></td></tr> | ||
| 3829 | <tr><td></td><td valign="top"><a href="#index-sinf"><code>sinf</code></a>:</td><td> </td><td valign="top"><a href="#sin">sin</a></td></tr> | ||
| 3830 | <tr><td></td><td valign="top"><a href="#index-sinh"><code>sinh</code></a>:</td><td> </td><td valign="top"><a href="#sinh">sinh</a></td></tr> | ||
| 3831 | <tr><td></td><td valign="top"><a href="#index-sinhf"><code>sinhf</code></a>:</td><td> </td><td valign="top"><a href="#sinh">sinh</a></td></tr> | ||
| 3832 | <tr><td></td><td valign="top"><a href="#index-sqrt"><code>sqrt</code></a>:</td><td> </td><td valign="top"><a href="#sqrt">sqrt</a></td></tr> | ||
| 3833 | <tr><td></td><td valign="top"><a href="#index-sqrtf"><code>sqrtf</code></a>:</td><td> </td><td valign="top"><a href="#sqrt">sqrt</a></td></tr> | ||
| 3834 | <tr><td></td><td valign="top"><a href="#index-stubs">stubs</a>:</td><td> </td><td valign="top"><a href="#Math">Math</a></td></tr> | ||
| 3835 | <tr><td></td><td valign="top"><a href="#index-support-subroutines">support subroutines</a>:</td><td> </td><td valign="top"><a href="#Math">Math</a></td></tr> | ||
| 3836 | <tr><td></td><td valign="top"><a href="#index-system-calls">system calls</a>:</td><td> </td><td valign="top"><a href="#Math">Math</a></td></tr> | ||
| 3837 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3838 | <tr><th><a name="Document-Index_cp_letter-T">T</a></th><td></td><td></td></tr> | ||
| 3839 | <tr><td></td><td valign="top"><a href="#index-tan"><code>tan</code></a>:</td><td> </td><td valign="top"><a href="#tan">tan</a></td></tr> | ||
| 3840 | <tr><td></td><td valign="top"><a href="#index-tanf"><code>tanf</code></a>:</td><td> </td><td valign="top"><a href="#tan">tan</a></td></tr> | ||
| 3841 | <tr><td></td><td valign="top"><a href="#index-tanh"><code>tanh</code></a>:</td><td> </td><td valign="top"><a href="#tanh">tanh</a></td></tr> | ||
| 3842 | <tr><td></td><td valign="top"><a href="#index-tanhf"><code>tanhf</code></a>:</td><td> </td><td valign="top"><a href="#tanh">tanh</a></td></tr> | ||
| 3843 | <tr><td></td><td valign="top"><a href="#index-tgamma"><code>tgamma</code></a>:</td><td> </td><td valign="top"><a href="#gamma">gamma</a></td></tr> | ||
| 3844 | <tr><td></td><td valign="top"><a href="#index-tgammaf"><code>tgammaf</code></a>:</td><td> </td><td valign="top"><a href="#gamma">gamma</a></td></tr> | ||
| 3845 | <tr><td></td><td valign="top"><a href="#index-trunc"><code>trunc</code></a>:</td><td> </td><td valign="top"><a href="#trunc">trunc</a></td></tr> | ||
| 3846 | <tr><td></td><td valign="top"><a href="#index-truncf"><code>truncf</code></a>:</td><td> </td><td valign="top"><a href="#trunc">trunc</a></td></tr> | ||
| 3847 | <tr><td colspan="4"> <hr></td></tr> | ||
| 3848 | <tr><th><a name="Document-Index_cp_letter-Y">Y</a></th><td></td><td></td></tr> | ||
| 3849 | <tr><td></td><td valign="top"><a href="#index-y0"><code>y0</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3850 | <tr><td></td><td valign="top"><a href="#index-y0f"><code>y0f</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3851 | <tr><td></td><td valign="top"><a href="#index-y1"><code>y1</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3852 | <tr><td></td><td valign="top"><a href="#index-y1f"><code>y1f</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3853 | <tr><td></td><td valign="top"><a href="#index-yn"><code>yn</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3854 | <tr><td></td><td valign="top"><a href="#index-ynf"><code>ynf</code></a>:</td><td> </td><td valign="top"><a href="#jN">jN</a></td></tr> | ||
| 3855 | <tr><td colspan="4"> <hr></td></tr> | 3963 | <tr><td colspan="4"> <hr></td></tr> |
| 3856 | </table> | 3964 | </table> |
| 3857 | <table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Document-Index_cp_letter-A"><b>A</b></a> | 3965 | <table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Document-Index_cp_letter-M"><b>M</b></a> |
| 3858 | | ||
| 3859 | <a class="summary-letter" href="#Document-Index_cp_letter-C"><b>C</b></a> | ||
| 3860 | | ||
| 3861 | <a class="summary-letter" href="#Document-Index_cp_letter-E"><b>E</b></a> | ||
| 3862 | | ||
| 3863 | <a class="summary-letter" href="#Document-Index_cp_letter-F"><b>F</b></a> | ||
| 3864 | | ||
| 3865 | <a class="summary-letter" href="#Document-Index_cp_letter-G"><b>G</b></a> | ||
| 3866 | | ||
| 3867 | <a class="summary-letter" href="#Document-Index_cp_letter-H"><b>H</b></a> | ||
| 3868 | | ||
| 3869 | <a class="summary-letter" href="#Document-Index_cp_letter-I"><b>I</b></a> | ||
| 3870 | | ||
| 3871 | <a class="summary-letter" href="#Document-Index_cp_letter-J"><b>J</b></a> | ||
| 3872 | | ||
| 3873 | <a class="summary-letter" href="#Document-Index_cp_letter-L"><b>L</b></a> | ||
| 3874 | | ||
| 3875 | <a class="summary-letter" href="#Document-Index_cp_letter-M"><b>M</b></a> | ||
| 3876 | | ||
| 3877 | <a class="summary-letter" href="#Document-Index_cp_letter-N"><b>N</b></a> | ||
| 3878 | | ||
| 3879 | <a class="summary-letter" href="#Document-Index_cp_letter-O"><b>O</b></a> | ||
| 3880 | | ||
| 3881 | <a class="summary-letter" href="#Document-Index_cp_letter-P"><b>P</b></a> | ||
| 3882 | | 3966 | |
| 3883 | <a class="summary-letter" href="#Document-Index_cp_letter-R"><b>R</b></a> | 3967 | <a class="summary-letter" href="#Document-Index_cp_letter-R"><b>R</b></a> |
| 3884 | | 3968 | |
| 3885 | <a class="summary-letter" href="#Document-Index_cp_letter-S"><b>S</b></a> | ||
| 3886 | | ||
| 3887 | <a class="summary-letter" href="#Document-Index_cp_letter-T"><b>T</b></a> | ||
| 3888 | | ||
| 3889 | <a class="summary-letter" href="#Document-Index_cp_letter-Y"><b>Y</b></a> | ||
| 3890 | | ||
| 3891 | </td></tr></table> | 3969 | </td></tr></table> |
| 3892 | 3970 | ||
| 3893 | 3971 | ||
| 3894 | <a name="SEC_Contents"></a> | ||
| 3895 | <h2 class="contents-heading">Table of Contents</h2> | ||
| 3896 | |||
| 3897 | <div class="contents"> | ||
| 3898 | |||
| 3899 | <ul class="no-bullet"> | ||
| 3900 | <li><a name="toc-Mathematical-Functions-_0028math_002eh_0029" href="#Math">1 Mathematical Functions (<samp>math.h</samp>)</a> | ||
| 3901 | <ul class="no-bullet"> | ||
| 3902 | <li><a name="toc-Error-Handling" href="#version">1.1 Error Handling</a></li> | ||
| 3903 | <li><a name="toc-Standards-Compliance-And-Portability" href="#Standards-Compliance-And-Portability">1.2 Standards Compliance And Portability</a></li> | ||
| 3904 | <li><a name="toc-acos_002c-acosf_002d_002d_002darc-cosine" href="#acos">1.3 <code>acos</code>, <code>acosf</code>—arc cosine</a></li> | ||
| 3905 | <li><a name="toc-acosh_002c-acoshf_002d_002d_002dinverse-hyperbolic-cosine" href="#acosh">1.4 <code>acosh</code>, <code>acoshf</code>—inverse hyperbolic cosine</a></li> | ||
| 3906 | <li><a name="toc-asin_002c-asinf_002d_002d_002darc-sine" href="#asin">1.5 <code>asin</code>, <code>asinf</code>—arc sine</a></li> | ||
| 3907 | <li><a name="toc-asinh_002c-asinhf_002d_002d_002dinverse-hyperbolic-sine" href="#asinh">1.6 <code>asinh</code>, <code>asinhf</code>—inverse hyperbolic sine</a></li> | ||
| 3908 | <li><a name="toc-atan_002c-atanf_002d_002d_002darc-tangent" href="#atan">1.7 <code>atan</code>, <code>atanf</code>—arc tangent</a></li> | ||
| 3909 | <li><a name="toc-atan2_002c-atan2f_002d_002d_002darc-tangent-of-y_002fx" href="#atan2">1.8 <code>atan2</code>, <code>atan2f</code>—arc tangent of y/x</a></li> | ||
| 3910 | <li><a name="toc-atanh_002c-atanhf_002d_002d_002dinverse-hyperbolic-tangent" href="#atanh">1.9 <code>atanh</code>, <code>atanhf</code>—inverse hyperbolic tangent</a></li> | ||
| 3911 | <li><a name="toc-jN_002c-jNf_002c-yN_002c-yNf_002d_002d_002dBessel-functions" href="#jN">1.10 <code>jN</code>, <code>jNf</code>, <code>yN</code>, <code>yNf</code>—Bessel functions</a></li> | ||
| 3912 | <li><a name="toc-cbrt_002c-cbrtf_002d_002d_002dcube-root" href="#cbrt">1.11 <code>cbrt</code>, <code>cbrtf</code>—cube root</a></li> | ||
| 3913 | <li><a name="toc-copysign_002c-copysignf_002d_002d_002dsign-of-y_002c-magnitude-of-x" href="#copysign">1.12 <code>copysign</code>, <code>copysignf</code>—sign of <var>y</var>, magnitude of <var>x</var></a></li> | ||
| 3914 | <li><a name="toc-cosh_002c-coshf_002d_002d_002dhyperbolic-cosine" href="#cosh">1.13 <code>cosh</code>, <code>coshf</code>—hyperbolic cosine</a></li> | ||
| 3915 | <li><a name="toc-erf_002c-erff_002c-erfc_002c-erfcf_002d_002d_002derror-function" href="#erf">1.14 <code>erf</code>, <code>erff</code>, <code>erfc</code>, <code>erfcf</code>—error function</a></li> | ||
| 3916 | <li><a name="toc-exp_002c-expf_002d_002d_002dexponential" href="#exp">1.15 <code>exp</code>, <code>expf</code>—exponential</a></li> | ||
| 3917 | <li><a name="toc-exp2_002c-exp2f_002d_002dexponential_002c-base-2" href="#exp2">1.16 <code>exp2</code>, <code>exp2f</code>–exponential, base 2</a></li> | ||
| 3918 | <li><a name="toc-expm1_002c-expm1f_002d_002d_002dexponential-minus-1" href="#expm1">1.17 <code>expm1</code>, <code>expm1f</code>—exponential minus 1</a></li> | ||
| 3919 | <li><a name="toc-fabs_002c-fabsf_002d_002d_002dabsolute-value-_0028magnitude_0029" href="#fabs">1.18 <code>fabs</code>, <code>fabsf</code>—absolute value (magnitude)</a></li> | ||
| 3920 | <li><a name="toc-fdim_002c-fdimf_002d_002dpositive-difference" href="#fdim">1.19 <code>fdim</code>, <code>fdimf</code>–positive difference</a></li> | ||
| 3921 | <li><a name="toc-floor_002c-floorf_002c-ceil_002c-ceilf_002d_002d_002dfloor-and-ceiling" href="#floor">1.20 <code>floor</code>, <code>floorf</code>, <code>ceil</code>, <code>ceilf</code>—floor and ceiling</a></li> | ||
| 3922 | <li><a name="toc-fma_002c-fmaf_002d_002dfloating-multiply-add" href="#fma">1.21 <code>fma</code>, <code>fmaf</code>–floating multiply add</a></li> | ||
| 3923 | <li><a name="toc-fmax_002c-fmaxf_002d_002dmaximum" href="#fmax">1.22 <code>fmax</code>, <code>fmaxf</code>–maximum</a></li> | ||
| 3924 | <li><a name="toc-fmin_002c-fminf_002d_002dminimum" href="#fmin">1.23 <code>fmin</code>, <code>fminf</code>–minimum</a></li> | ||
| 3925 | <li><a name="toc-fmod_002c-fmodf_002d_002d_002dfloating_002dpoint-remainder-_0028modulo_0029" href="#fmod">1.24 <code>fmod</code>, <code>fmodf</code>—floating-point remainder (modulo)</a></li> | ||
| 3926 | <li><a name="toc-frexp_002c-frexpf_002d_002d_002dsplit-floating_002dpoint-number" href="#frexp">1.25 <code>frexp</code>, <code>frexpf</code>—split floating-point number</a></li> | ||
| 3927 | <li><a name="toc-gamma_002c-gammaf_002c-lgamma_002c-lgammaf_002c-gamma_005fr_002c-gammaf_005fr_002c-lgamma_005fr_002c-lgammaf_005fr_002c-tgamma_002c-and-tgammaf_002d_002dlogarithmic-and-plain-gamma-functions" href="#gamma">1.26 <code>gamma</code>, <code>gammaf</code>, <code>lgamma</code>, <code>lgammaf</code>, <code>gamma_r</code>, <code>gammaf_r</code>, <code>lgamma_r</code>, <code>lgammaf_r</code>, <code>tgamma</code>, and <code>tgammaf</code>–logarithmic and plain gamma functions</a></li> | ||
| 3928 | <li><a name="toc-hypot_002c-hypotf_002d_002d_002ddistance-from-origin" href="#hypot">1.27 <code>hypot</code>, <code>hypotf</code>—distance from origin</a></li> | ||
| 3929 | <li><a name="toc-ilogb_002c-ilogbf_002d_002d_002dget-exponent-of-floating_002dpoint-number" href="#ilogb">1.28 <code>ilogb</code>, <code>ilogbf</code>—get exponent of floating-point number</a></li> | ||
| 3930 | <li><a name="toc-infinity_002c-infinityf_002d_002drepresentation-of-infinity" href="#infinity">1.29 <code>infinity</code>, <code>infinityf</code>–representation of infinity</a></li> | ||
| 3931 | <li><a name="toc-isgreater_002c-isgreaterequal_002c-isless_002c-islessequal_002c-islessgreater_002c-and-isunordered_002d_002dcomparison-macros" href="#isgreater">1.30 <code>isgreater</code>, <code>isgreaterequal</code>, <code>isless</code>, <code>islessequal</code>, <code>islessgreater</code>, and <code>isunordered</code>–comparison macros</a></li> | ||
| 3932 | <li><a name="toc-fpclassify_002c-isfinite_002c-isinf_002c-isnan_002c-and-isnormal_002d_002dfloating_002dpoint-classification-macros_003b-finite_002c-finitef_002c-isinf_002c-isinff_002c-isnan_002c-isnanf_002d_002dtest-for-exceptional-numbers" href="#fpclassify">1.31 <code>fpclassify</code>, <code>isfinite</code>, <code>isinf</code>, <code>isnan</code>, and <code>isnormal</code>–floating-point classification macros; <code>finite</code>, <code>finitef</code>, <code>isinf</code>, <code>isinff</code>, <code>isnan</code>, <code>isnanf</code>–test for exceptional numbers</a></li> | ||
| 3933 | <li><a name="toc-ldexp_002c-ldexpf_002d_002d_002dload-exponent" href="#ldexp">1.32 <code>ldexp</code>, <code>ldexpf</code>—load exponent</a></li> | ||
| 3934 | <li><a name="toc-log_002c-logf_002d_002d_002dnatural-logarithms" href="#log">1.33 <code>log</code>, <code>logf</code>—natural logarithms</a></li> | ||
| 3935 | <li><a name="toc-log10_002c-log10f_002d_002d_002dbase-10-logarithms" href="#log10">1.34 <code>log10</code>, <code>log10f</code>—base 10 logarithms</a></li> | ||
| 3936 | <li><a name="toc-log1p_002c-log1pf_002d_002d_002dlog-of-1-_002b-x" href="#log1p">1.35 <code>log1p</code>, <code>log1pf</code>—log of <code>1 + <var>x</var></code></a></li> | ||
| 3937 | <li><a name="toc-log2_002c-log2f_002d_002dbase-2-logarithm" href="#log2">1.36 <code>log2</code>, <code>log2f</code>–base 2 logarithm</a></li> | ||
| 3938 | <li><a name="toc-logb_002c-logbf_002d_002dget-exponent-of-floating_002dpoint-number" href="#logb">1.37 <code>logb</code>, <code>logbf</code>–get exponent of floating-point number</a></li> | ||
| 3939 | <li><a name="toc-lrint_002c-lrintf_002c-llrint_002c-llrintf_002d_002dround-to-integer" href="#lrint">1.38 <code>lrint</code>, <code>lrintf</code>, <code>llrint</code>, <code>llrintf</code>–round to integer</a></li> | ||
| 3940 | <li><a name="toc-lround_002c-lroundf_002c-llround_002c-llroundf_002d_002dround-to-integer_002c-to-nearest" href="#lround">1.39 <code>lround</code>, <code>lroundf</code>, <code>llround</code>, <code>llroundf</code>–round to integer, to nearest</a></li> | ||
| 3941 | <li><a name="toc-matherr_002d_002d_002dmodifiable-math-error-handler" href="#matherr">1.40 <code>matherr</code>—modifiable math error handler</a></li> | ||
| 3942 | <li><a name="toc-modf_002c-modff_002d_002d_002dsplit-fractional-and-integer-parts" href="#modf">1.41 <code>modf</code>, <code>modff</code>—split fractional and integer parts</a></li> | ||
| 3943 | <li><a name="toc-nan_002c-nanf_002d_002d_002drepresentation-of-_0060_0060Not-a-Number_0027_0027" href="#nan">1.42 <code>nan</code>, <code>nanf</code>—representation of “Not a Number”</a></li> | ||
| 3944 | <li><a name="toc-nearbyint_002c-nearbyintf_002d_002dround-to-integer" href="#nearbyint">1.43 <code>nearbyint</code>, <code>nearbyintf</code>–round to integer</a></li> | ||
| 3945 | <li><a name="toc-nextafter_002c-nextafterf_002d_002d_002dget-next-number" href="#nextafter">1.44 <code>nextafter</code>, <code>nextafterf</code>—get next number</a></li> | ||
| 3946 | <li><a name="toc-pow_002c-powf_002d_002d_002dx-to-the-power-y" href="#pow">1.45 <code>pow</code>, <code>powf</code>—x to the power y</a></li> | ||
| 3947 | <li><a name="toc-remainder_002c-remainderf_002d_002d_002dround-and-remainder" href="#remainder">1.46 <code>remainder</code>, <code>remainderf</code>—round and remainder</a></li> | ||
| 3948 | <li><a name="toc-remquo_002c-remquof_002d_002dremainder-and-part-of-quotient" href="#remquo">1.47 <code>remquo</code>, <code>remquof</code>–remainder and part of quotient</a></li> | ||
| 3949 | <li><a name="toc-rint_002c-rintf_002d_002dround-to-integer" href="#rint">1.48 <code>rint</code>, <code>rintf</code>–round to integer</a></li> | ||
| 3950 | <li><a name="toc-round_002c-roundf_002d_002dround-to-integer_002c-to-nearest" href="#round">1.49 <code>round</code>, <code>roundf</code>–round to integer, to nearest</a></li> | ||
| 3951 | <li><a name="toc-scalbn_002c-scalbnf_002c-scalbln_002c-scalblnf_002d_002dscale-by-power-of-FLT_005fRADIX-_0028_003d2_0029" href="#scalbn">1.50 <code>scalbn</code>, <code>scalbnf</code>, <code>scalbln</code>, <code>scalblnf</code>–scale by power of FLT_RADIX (=2)</a></li> | ||
| 3952 | <li><a name="toc-signbit_002d_002dDoes-floating_002dpoint-number-have-negative-sign_003f" href="#signbit">1.51 <code>signbit</code>–Does floating-point number have negative sign?</a></li> | ||
| 3953 | <li><a name="toc-sin_002c-sinf_002c-cos_002c-cosf_002d_002d_002dsine-or-cosine" href="#sin">1.52 <code>sin</code>, <code>sinf</code>, <code>cos</code>, <code>cosf</code>—sine or cosine</a></li> | ||
| 3954 | <li><a name="toc-sinh_002c-sinhf_002d_002d_002dhyperbolic-sine" href="#sinh">1.53 <code>sinh</code>, <code>sinhf</code>—hyperbolic sine</a></li> | ||
| 3955 | <li><a name="toc-sqrt_002c-sqrtf_002d_002d_002dpositive-square-root" href="#sqrt">1.54 <code>sqrt</code>, <code>sqrtf</code>—positive square root</a></li> | ||
| 3956 | <li><a name="toc-tan_002c-tanf_002d_002d_002dtangent" href="#tan">1.55 <code>tan</code>, <code>tanf</code>—tangent</a></li> | ||
| 3957 | <li><a name="toc-tanh_002c-tanhf_002d_002d_002dhyperbolic-tangent" href="#tanh">1.56 <code>tanh</code>, <code>tanhf</code>—hyperbolic tangent</a></li> | ||
| 3958 | <li><a name="toc-trunc_002c-truncf_002d_002dround-to-integer_002c-towards-zero" href="#trunc">1.57 <code>trunc</code>, <code>truncf</code>–round to integer, towards zero</a></li> | ||
| 3959 | </ul></li> | ||
| 3960 | <li><a name="toc-Mathematical-Complex-Functions-_0028complex_002eh_0029" href="#Complex">2 Mathematical Complex Functions (<samp>complex.h</samp>)</a> | ||
| 3961 | <ul class="no-bullet"> | ||
| 3962 | <li><a name="toc-cabs_002c-cabsf_002d_002d_002dcomplex-absolute_002dvalue" href="#cabs">2.1 <code>cabs</code>, <code>cabsf</code>—complex absolute-value</a></li> | ||
| 3963 | <li><a name="toc-cacos_002c-cacosf_002d_002d_002dcomplex-arc-cosine" href="#cacos">2.2 <code>cacos</code>, <code>cacosf</code>—complex arc cosine</a></li> | ||
| 3964 | <li><a name="toc-cacosh_002c-cacoshf_002d_002d_002dcomplex-arc-hyperbolic-cosine" href="#cacosh">2.3 <code>cacosh</code>, <code>cacoshf</code>—complex arc hyperbolic cosine</a></li> | ||
| 3965 | <li><a name="toc-carg_002c-cargf_002d_002d_002dargument-_0028phase-angle_0029" href="#carg">2.4 <code>carg</code>, <code>cargf</code>—argument (phase angle)</a></li> | ||
| 3966 | <li><a name="toc-casin_002c-casinf_002d_002d_002dcomplex-arc-sine" href="#casin">2.5 <code>casin</code>, <code>casinf</code>—complex arc sine</a></li> | ||
| 3967 | <li><a name="toc-casinh_002c-casinhf_002d_002d_002dcomplex-arc-hyperbolic-sine" href="#casinh">2.6 <code>casinh</code>, <code>casinhf</code>—complex arc hyperbolic sine</a></li> | ||
| 3968 | <li><a name="toc-catan_002c-catanf_002d_002d_002dcomplex-arc-tangent" href="#catan">2.7 <code>catan</code>, <code>catanf</code>—complex arc tangent</a></li> | ||
| 3969 | <li><a name="toc-catanh_002c-catanhf_002d_002d_002dcomplex-arc-hyperbolic-tangent" href="#catanh">2.8 <code>catanh</code>, <code>catanhf</code>—complex arc hyperbolic tangent</a></li> | ||
| 3970 | <li><a name="toc-ccos_002c-ccosf_002d_002d_002dcomplex-cosine" href="#ccos">2.9 <code>ccos</code>, <code>ccosf</code>—complex cosine</a></li> | ||
| 3971 | <li><a name="toc-ccosh_002c-ccoshf_002d_002d_002dcomplex-hyperbolic-cosine" href="#ccosh">2.10 <code>ccosh</code>, <code>ccoshf</code>—complex hyperbolic cosine</a></li> | ||
| 3972 | <li><a name="toc-cexp_002c-cexpf_002d_002d_002dcomplex-base_002de-exponential" href="#cexp">2.11 <code>cexp</code>, <code>cexpf</code>—complex base-e exponential</a></li> | ||
| 3973 | <li><a name="toc-cimag_002c-cimagf_002d_002d_002dimaginary-part" href="#cimag">2.12 <code>cimag</code>, <code>cimagf</code>—imaginary part</a></li> | ||
| 3974 | <li><a name="toc-clog_002c-clogf_002d_002d_002dcomplex-base_002de-logarithm" href="#clog">2.13 <code>clog</code>, <code>clogf</code>—complex base-e logarithm</a></li> | ||
| 3975 | <li><a name="toc-conj_002c-conjf_002d_002d_002dcomplex-conjugate" href="#conj">2.14 <code>conj</code>, <code>conjf</code>—complex conjugate</a></li> | ||
| 3976 | <li><a name="toc-cpow_002c-cpowf_002d_002d_002dcomplex-power" href="#cpow">2.15 <code>cpow</code>, <code>cpowf</code>—complex power</a></li> | ||
| 3977 | <li><a name="toc-cproj_002c-cprojf_002d_002d_002d-Riemann-sphere-projection" href="#cproj">2.16 <code>cproj</code>, <code>cprojf</code>— Riemann sphere projection</a></li> | ||
| 3978 | <li><a name="toc-creal_002c-crealf_002d_002d_002dreal-part" href="#creal">2.17 <code>creal</code>, <code>crealf</code>—real part</a></li> | ||
| 3979 | <li><a name="toc-csin_002c-csinf_002d_002d_002dcomplex-sine" href="#csin">2.18 <code>csin</code>, <code>csinf</code>—complex sine</a></li> | ||
| 3980 | <li><a name="toc-csinh_002c-csinhf_002d_002d_002dcomplex-hyperbolic-sine" href="#csinh">2.19 <code>csinh</code>, <code>csinhf</code>—complex hyperbolic sine</a></li> | ||
| 3981 | <li><a name="toc-csqrt_002c-csqrtf_002d_002d_002dcomplex-square-root" href="#csqrt">2.20 <code>csqrt</code>, <code>csqrtf</code>—complex square root</a></li> | ||
| 3982 | <li><a name="toc-ctan_002c-ctanf_002d_002d_002dcomplex-tangent" href="#ctan">2.21 <code>ctan</code>, <code>ctanf</code>—complex tangent</a></li> | ||
| 3983 | <li><a name="toc-ctanh_002c-ctanf_002d_002d_002dcomplex-hyperbolic-tangent" href="#ctanh">2.22 <code>ctanh</code>, <code>ctanf</code>—complex hyperbolic tangent</a></li> | ||
| 3984 | </ul></li> | ||
| 3985 | <li><a name="toc-Reentrancy-Properties-of-libm" href="#Reentrancy">3 Reentrancy Properties of <code>libm</code></a></li> | ||
| 3986 | <li><a name="toc-The-long-double-function-support-of-libm" href="#Long-Double-Functions">4 The long double function support of <code>libm</code></a></li> | ||
| 3987 | <li><a name="toc-Document-Index-1" href="#Document-Index">Document Index</a></li> | ||
| 3988 | </ul> | ||
| 3989 | </div> | 3972 | </div> |
| 3990 | 3973 | </div> | |
| 3991 | <hr> | ||
| 3992 | 3974 | ||
| 3993 | 3975 | ||
| 3994 | 3976 | ||
