You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

203 lines
13KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>Math (LIBM)</title>
  7. <meta name="description" content="Math (LIBM)">
  8. <meta name="keywords" content="Math (LIBM)">
  9. <meta name="resource-type" content="document">
  10. <meta name="distribution" content="global">
  11. <meta name="Generator" content="makeinfo">
  12. <link href="index.html#Top" rel="start" title="Top">
  13. <link href="Document-Index.html#Document-Index" rel="index" title="Document Index">
  14. <link href="Document-Index.html#SEC_Contents" rel="contents" title="Table of Contents">
  15. <link href="index.html#Top" rel="up" title="Top">
  16. <link href="version.html#version" rel="next" title="version">
  17. <link href="index.html#Top" rel="prev" title="Top">
  18. <style type="text/css">
  19. <!--
  20. a.summary-letter {text-decoration: none}
  21. blockquote.indentedblock {margin-right: 0em}
  22. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  23. blockquote.smallquotation {font-size: smaller}
  24. div.display {margin-left: 3.2em}
  25. div.example {margin-left: 3.2em}
  26. div.lisp {margin-left: 3.2em}
  27. div.smalldisplay {margin-left: 3.2em}
  28. div.smallexample {margin-left: 3.2em}
  29. div.smalllisp {margin-left: 3.2em}
  30. kbd {font-style: oblique}
  31. pre.display {font-family: inherit}
  32. pre.format {font-family: inherit}
  33. pre.menu-comment {font-family: serif}
  34. pre.menu-preformatted {font-family: serif}
  35. pre.smalldisplay {font-family: inherit; font-size: smaller}
  36. pre.smallexample {font-size: smaller}
  37. pre.smallformat {font-family: inherit; font-size: smaller}
  38. pre.smalllisp {font-size: smaller}
  39. span.nolinebreak {white-space: nowrap}
  40. span.roman {font-family: initial; font-weight: normal}
  41. span.sansserif {font-family: sans-serif; font-weight: normal}
  42. ul.no-bullet {list-style: none}
  43. -->
  44. </style>
  45. </head>
  46. <body lang="en">
  47. <a name="Math"></a>
  48. <div class="header">
  49. <p>
  50. Next: <a href="Complex.html#Complex" accesskey="n" rel="next">Complex</a>, Previous: <a href="index.html#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
  51. </div>
  52. <hr>
  53. <a name="Mathematical-Functions-_0028math_002eh_0029"></a>
  54. <h2 class="chapter">1 Mathematical Functions (<samp>math.h</samp>)</h2>
  55. <p>This chapter groups a wide variety of mathematical functions. The
  56. corresponding definitions and declarations are in <samp>math.h</samp>.
  57. The definition of HUGE_VAL from <samp>math.h</samp> is of particular interest.
  58. </p>
  59. <ol>
  60. <li> The representation of infinity as a <code>double</code> is defined as
  61. <code>HUGE_VAL</code>; this number is returned on overflow by many functions.
  62. The macro <code>HUGE_VALF</code> is a corresponding value for <code>float</code>.
  63. </li></ol>
  64. <p>Alternative declarations of the mathematical functions, which exploit
  65. specific machine capabilities to operate faster&mdash;but generally have
  66. less error checking and may reflect additional limitations on some
  67. machines&mdash;are available when you include <samp>fastmath.h</samp> instead of
  68. <samp>math.h</samp>.
  69. </p>
  70. <table class="menu" border="0" cellspacing="0">
  71. <tr><td align="left" valign="top">&bull; <a href="version.html#version" accesskey="1">version</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Version of library
  72. </td></tr>
  73. <tr><td align="left" valign="top">&bull; <a href="acos.html#acos" accesskey="2">acos</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Arccosine
  74. </td></tr>
  75. <tr><td align="left" valign="top">&bull; <a href="acosh.html#acosh" accesskey="3">acosh</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Inverse hyperbolic cosine
  76. </td></tr>
  77. <tr><td align="left" valign="top">&bull; <a href="asin.html#asin" accesskey="4">asin</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Arcsine
  78. </td></tr>
  79. <tr><td align="left" valign="top">&bull; <a href="asinh.html#asinh" accesskey="5">asinh</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Inverse hyperbolic sine
  80. </td></tr>
  81. <tr><td align="left" valign="top">&bull; <a href="atan.html#atan" accesskey="6">atan</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Arctangent
  82. </td></tr>
  83. <tr><td align="left" valign="top">&bull; <a href="atan2.html#atan2" accesskey="7">atan2</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Arctangent of y/x
  84. </td></tr>
  85. <tr><td align="left" valign="top">&bull; <a href="atanh.html#atanh" accesskey="8">atanh</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Inverse hyperbolic tangent
  86. </td></tr>
  87. <tr><td align="left" valign="top">&bull; <a href="jN.html#jN" accesskey="9">jN</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Bessel functions (jN, yN)
  88. </td></tr>
  89. <tr><td align="left" valign="top">&bull; <a href="cbrt.html#cbrt">cbrt</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Cube root
  90. </td></tr>
  91. <tr><td align="left" valign="top">&bull; <a href="copysign.html#copysign">copysign</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Sign of Y, magnitude of X
  92. </td></tr>
  93. <tr><td align="left" valign="top">&bull; <a href="cosh.html#cosh">cosh</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Hyperbolic cosine
  94. </td></tr>
  95. <tr><td align="left" valign="top">&bull; <a href="erf.html#erf">erf</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Error function (erf, erfc)
  96. </td></tr>
  97. <tr><td align="left" valign="top">&bull; <a href="exp.html#exp">exp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Exponential, base e
  98. </td></tr>
  99. <tr><td align="left" valign="top">&bull; <a href="exp10.html#exp10">exp10</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Exponential, base 10
  100. </td></tr>
  101. <tr><td align="left" valign="top">&bull; <a href="exp2.html#exp2">exp2</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Exponential, base 2
  102. </td></tr>
  103. <tr><td align="left" valign="top">&bull; <a href="expm1.html#expm1">expm1</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Exponential, base e, of x - 1
  104. </td></tr>
  105. <tr><td align="left" valign="top">&bull; <a href="fabs.html#fabs">fabs</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Absolute value (magnitude)
  106. </td></tr>
  107. <tr><td align="left" valign="top">&bull; <a href="fdim.html#fdim">fdim</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Positive difference
  108. </td></tr>
  109. <tr><td align="left" valign="top">&bull; <a href="floor.html#floor">floor</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Floor and ceiling (floor, ceil)
  110. </td></tr>
  111. <tr><td align="left" valign="top">&bull; <a href="fma.html#fma">fma</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Floating multiply add
  112. </td></tr>
  113. <tr><td align="left" valign="top">&bull; <a href="fmax.html#fmax">fmax</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Maximum
  114. </td></tr>
  115. <tr><td align="left" valign="top">&bull; <a href="fmin.html#fmin">fmin</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Minimum
  116. </td></tr>
  117. <tr><td align="left" valign="top">&bull; <a href="fmod.html#fmod">fmod</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Floating-point remainder (modulo)
  118. </td></tr>
  119. <tr><td align="left" valign="top">&bull; <a href="fpclassify.html#fpclassify">fpclassify</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Floating-point classification macro
  120. </td></tr>
  121. <tr><td align="left" valign="top">&bull; <a href="frexp.html#frexp">frexp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Split floating-point number
  122. </td></tr>
  123. <tr><td align="left" valign="top">&bull; <a href="gamma.html#gamma">gamma</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Logarithmic gamma function
  124. </td></tr>
  125. <tr><td align="left" valign="top">&bull; <a href="hypot.html#hypot">hypot</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Distance from origin
  126. </td></tr>
  127. <tr><td align="left" valign="top">&bull; <a href="ilogb.html#ilogb">ilogb</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Get exponent
  128. </td></tr>
  129. <tr><td align="left" valign="top">&bull; <a href="infinity.html#infinity">infinity</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Floating infinity
  130. </td></tr>
  131. <tr><td align="left" valign="top">&bull; <a href="isgreater.html#isgreater">isgreater</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Comparison macros
  132. </td></tr>
  133. <tr><td align="left" valign="top">&bull; <a href="ldexp.html#ldexp">ldexp</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Scale by a power of 2
  134. </td></tr>
  135. <tr><td align="left" valign="top">&bull; <a href="log.html#log">log</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Natural logarithms
  136. </td></tr>
  137. <tr><td align="left" valign="top">&bull; <a href="log10.html#log10">log10</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Base 10 logarithms
  138. </td></tr>
  139. <tr><td align="left" valign="top">&bull; <a href="log1p.html#log1p">log1p</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Log of 1 + X
  140. </td></tr>
  141. <tr><td align="left" valign="top">&bull; <a href="log2.html#log2">log2</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Base 2 logarithms
  142. </td></tr>
  143. <tr><td align="left" valign="top">&bull; <a href="logb.html#logb">logb</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Get exponent
  144. </td></tr>
  145. <tr><td align="left" valign="top">&bull; <a href="lrint.html#lrint">lrint</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Round to integer
  146. </td></tr>
  147. <tr><td align="left" valign="top">&bull; <a href="lround.html#lround">lround</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Round to integer, away from zero (lround, llround)
  148. </td></tr>
  149. <tr><td align="left" valign="top">&bull; <a href="modf.html#modf">modf</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Split fractional and integer parts
  150. </td></tr>
  151. <tr><td align="left" valign="top">&bull; <a href="nan.html#nan">nan</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Floating Not a Number
  152. </td></tr>
  153. <tr><td align="left" valign="top">&bull; <a href="nearbyint.html#nearbyint">nearbyint</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Round to integer
  154. </td></tr>
  155. <tr><td align="left" valign="top">&bull; <a href="nextafter.html#nextafter">nextafter</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Get next representable number
  156. </td></tr>
  157. <tr><td align="left" valign="top">&bull; <a href="pow.html#pow">pow</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">X to the power Y
  158. </td></tr>
  159. <tr><td align="left" valign="top">&bull; <a href="pow10.html#pow10">pow10</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">10 to the power X
  160. </td></tr>
  161. <tr><td align="left" valign="top">&bull; <a href="remainder.html#remainder">remainder</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">remainder of X divided by Y
  162. </td></tr>
  163. <tr><td align="left" valign="top">&bull; <a href="remquo.html#remquo">remquo</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Remainder and part of quotient
  164. </td></tr>
  165. <tr><td align="left" valign="top">&bull; <a href="rint.html#rint">rint</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Round to integer
  166. </td></tr>
  167. <tr><td align="left" valign="top">&bull; <a href="round.html#round">round</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Round to integer, away from zero
  168. </td></tr>
  169. <tr><td align="left" valign="top">&bull; <a href="scalbn.html#scalbn">scalbn</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Scale by a power of FLT_RADIX (2)
  170. </td></tr>
  171. <tr><td align="left" valign="top">&bull; <a href="signbit.html#signbit">signbit</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Does floating-point number have negative sign?
  172. </td></tr>
  173. <tr><td align="left" valign="top">&bull; <a href="sin.html#sin">sin</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Sine or cosine (sin, cos)
  174. </td></tr>
  175. <tr><td align="left" valign="top">&bull; <a href="sinh.html#sinh">sinh</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Hyperbolic sine
  176. </td></tr>
  177. <tr><td align="left" valign="top">&bull; <a href="sqrt.html#sqrt">sqrt</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Positive square root
  178. </td></tr>
  179. <tr><td align="left" valign="top">&bull; <a href="tan.html#tan">tan</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Tangent
  180. </td></tr>
  181. <tr><td align="left" valign="top">&bull; <a href="tanh.html#tanh">tanh</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Hyperbolic tangent
  182. </td></tr>
  183. <tr><td align="left" valign="top">&bull; <a href="trunc.html#trunc">trunc</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Round to integer, towards zero
  184. </td></tr>
  185. </table>
  186. <hr>
  187. <div class="header">
  188. <p>
  189. Next: <a href="Complex.html#Complex" accesskey="n" rel="next">Complex</a>, Previous: <a href="index.html#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
  190. </div>
  191. </body>
  192. </html>