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.

393 satır
28KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <title>Soft float library routines (GNU Compiler Collection (GCC) Internals)</title>
  21. <meta name="description" content="Soft float library routines (GNU Compiler Collection (GCC) Internals)">
  22. <meta name="keywords" content="Soft float library routines (GNU Compiler Collection (GCC) Internals)">
  23. <meta name="resource-type" content="document">
  24. <meta name="distribution" content="global">
  25. <meta name="Generator" content="makeinfo">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Libgcc.html#Libgcc" rel="up" title="Libgcc">
  30. <link href="Decimal-float-library-routines.html#Decimal-float-library-routines" rel="next" title="Decimal float library routines">
  31. <link href="Integer-library-routines.html#Integer-library-routines" rel="prev" title="Integer library routines">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.indentedblock {margin-right: 0em}
  36. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  37. blockquote.smallquotation {font-size: smaller}
  38. div.display {margin-left: 3.2em}
  39. div.example {margin-left: 3.2em}
  40. div.lisp {margin-left: 3.2em}
  41. div.smalldisplay {margin-left: 3.2em}
  42. div.smallexample {margin-left: 3.2em}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style: oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nolinebreak {white-space: nowrap}
  54. span.roman {font-family: initial; font-weight: normal}
  55. span.sansserif {font-family: sans-serif; font-weight: normal}
  56. ul.no-bullet {list-style: none}
  57. -->
  58. </style>
  59. </head>
  60. <body lang="en">
  61. <a name="Soft-float-library-routines"></a>
  62. <div class="header">
  63. <p>
  64. Next: <a href="Decimal-float-library-routines.html#Decimal-float-library-routines" accesskey="n" rel="next">Decimal float library routines</a>, Previous: <a href="Integer-library-routines.html#Integer-library-routines" accesskey="p" rel="prev">Integer library routines</a>, Up: <a href="Libgcc.html#Libgcc" accesskey="u" rel="up">Libgcc</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  65. </div>
  66. <hr>
  67. <a name="Routines-for-floating-point-emulation"></a>
  68. <h3 class="section">4.2 Routines for floating point emulation</h3>
  69. <a name="index-soft-float-library"></a>
  70. <a name="index-arithmetic-library"></a>
  71. <a name="index-math-library"></a>
  72. <a name="index-msoft_002dfloat"></a>
  73. <p>The software floating point library is used on machines which do not
  74. have hardware support for floating point. It is also used whenever
  75. <samp>-msoft-float</samp> is used to disable generation of floating point
  76. instructions. (Not all targets support this switch.)
  77. </p>
  78. <p>For compatibility with other compilers, the floating point emulation
  79. routines can be renamed with the <code>DECLARE_LIBRARY_RENAMES</code> macro
  80. (see <a href="Library-Calls.html#Library-Calls">Library Calls</a>). In this section, the default names are used.
  81. </p>
  82. <p>Presently the library does not support <code>XFmode</code>, which is used
  83. for <code>long double</code> on some architectures.
  84. </p>
  85. <a name="Arithmetic-functions-1"></a>
  86. <h4 class="subsection">4.2.1 Arithmetic functions</h4>
  87. <dl>
  88. <dt><a name="index-_005f_005faddsf3"></a>Runtime Function: <em>float</em> <strong>__addsf3</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  89. <dt><a name="index-_005f_005fadddf3"></a>Runtime Function: <em>double</em> <strong>__adddf3</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  90. <dt><a name="index-_005f_005faddtf3"></a>Runtime Function: <em>long double</em> <strong>__addtf3</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  91. <dt><a name="index-_005f_005faddxf3"></a>Runtime Function: <em>long double</em> <strong>__addxf3</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  92. <dd><p>These functions return the sum of <var>a</var> and <var>b</var>.
  93. </p></dd></dl>
  94. <dl>
  95. <dt><a name="index-_005f_005fsubsf3"></a>Runtime Function: <em>float</em> <strong>__subsf3</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  96. <dt><a name="index-_005f_005fsubdf3"></a>Runtime Function: <em>double</em> <strong>__subdf3</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  97. <dt><a name="index-_005f_005fsubtf3"></a>Runtime Function: <em>long double</em> <strong>__subtf3</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  98. <dt><a name="index-_005f_005fsubxf3"></a>Runtime Function: <em>long double</em> <strong>__subxf3</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  99. <dd><p>These functions return the difference between <var>b</var> and <var>a</var>;
  100. that is, <em><var>a</var> - <var>b</var></em><!-- /@w -->.
  101. </p></dd></dl>
  102. <dl>
  103. <dt><a name="index-_005f_005fmulsf3"></a>Runtime Function: <em>float</em> <strong>__mulsf3</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  104. <dt><a name="index-_005f_005fmuldf3"></a>Runtime Function: <em>double</em> <strong>__muldf3</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  105. <dt><a name="index-_005f_005fmultf3"></a>Runtime Function: <em>long double</em> <strong>__multf3</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  106. <dt><a name="index-_005f_005fmulxf3"></a>Runtime Function: <em>long double</em> <strong>__mulxf3</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  107. <dd><p>These functions return the product of <var>a</var> and <var>b</var>.
  108. </p></dd></dl>
  109. <dl>
  110. <dt><a name="index-_005f_005fdivsf3"></a>Runtime Function: <em>float</em> <strong>__divsf3</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  111. <dt><a name="index-_005f_005fdivdf3"></a>Runtime Function: <em>double</em> <strong>__divdf3</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  112. <dt><a name="index-_005f_005fdivtf3"></a>Runtime Function: <em>long double</em> <strong>__divtf3</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  113. <dt><a name="index-_005f_005fdivxf3"></a>Runtime Function: <em>long double</em> <strong>__divxf3</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  114. <dd><p>These functions return the quotient of <var>a</var> and <var>b</var>; that is,
  115. <em><var>a</var> / <var>b</var></em><!-- /@w -->.
  116. </p></dd></dl>
  117. <dl>
  118. <dt><a name="index-_005f_005fnegsf2"></a>Runtime Function: <em>float</em> <strong>__negsf2</strong> <em>(float <var>a</var>)</em></dt>
  119. <dt><a name="index-_005f_005fnegdf2"></a>Runtime Function: <em>double</em> <strong>__negdf2</strong> <em>(double <var>a</var>)</em></dt>
  120. <dt><a name="index-_005f_005fnegtf2"></a>Runtime Function: <em>long double</em> <strong>__negtf2</strong> <em>(long double <var>a</var>)</em></dt>
  121. <dt><a name="index-_005f_005fnegxf2"></a>Runtime Function: <em>long double</em> <strong>__negxf2</strong> <em>(long double <var>a</var>)</em></dt>
  122. <dd><p>These functions return the negation of <var>a</var>. They simply flip the
  123. sign bit, so they can produce negative zero and negative NaN.
  124. </p></dd></dl>
  125. <a name="Conversion-functions"></a>
  126. <h4 class="subsection">4.2.2 Conversion functions</h4>
  127. <dl>
  128. <dt><a name="index-_005f_005fextendsfdf2"></a>Runtime Function: <em>double</em> <strong>__extendsfdf2</strong> <em>(float <var>a</var>)</em></dt>
  129. <dt><a name="index-_005f_005fextendsftf2"></a>Runtime Function: <em>long double</em> <strong>__extendsftf2</strong> <em>(float <var>a</var>)</em></dt>
  130. <dt><a name="index-_005f_005fextendsfxf2"></a>Runtime Function: <em>long double</em> <strong>__extendsfxf2</strong> <em>(float <var>a</var>)</em></dt>
  131. <dt><a name="index-_005f_005fextenddftf2"></a>Runtime Function: <em>long double</em> <strong>__extenddftf2</strong> <em>(double <var>a</var>)</em></dt>
  132. <dt><a name="index-_005f_005fextenddfxf2"></a>Runtime Function: <em>long double</em> <strong>__extenddfxf2</strong> <em>(double <var>a</var>)</em></dt>
  133. <dd><p>These functions extend <var>a</var> to the wider mode of their return
  134. type.
  135. </p></dd></dl>
  136. <dl>
  137. <dt><a name="index-_005f_005ftruncxfdf2"></a>Runtime Function: <em>double</em> <strong>__truncxfdf2</strong> <em>(long double <var>a</var>)</em></dt>
  138. <dt><a name="index-_005f_005ftrunctfdf2"></a>Runtime Function: <em>double</em> <strong>__trunctfdf2</strong> <em>(long double <var>a</var>)</em></dt>
  139. <dt><a name="index-_005f_005ftruncxfsf2"></a>Runtime Function: <em>float</em> <strong>__truncxfsf2</strong> <em>(long double <var>a</var>)</em></dt>
  140. <dt><a name="index-_005f_005ftrunctfsf2"></a>Runtime Function: <em>float</em> <strong>__trunctfsf2</strong> <em>(long double <var>a</var>)</em></dt>
  141. <dt><a name="index-_005f_005ftruncdfsf2"></a>Runtime Function: <em>float</em> <strong>__truncdfsf2</strong> <em>(double <var>a</var>)</em></dt>
  142. <dd><p>These functions truncate <var>a</var> to the narrower mode of their return
  143. type, rounding toward zero.
  144. </p></dd></dl>
  145. <dl>
  146. <dt><a name="index-_005f_005ffixsfsi"></a>Runtime Function: <em>int</em> <strong>__fixsfsi</strong> <em>(float <var>a</var>)</em></dt>
  147. <dt><a name="index-_005f_005ffixdfsi"></a>Runtime Function: <em>int</em> <strong>__fixdfsi</strong> <em>(double <var>a</var>)</em></dt>
  148. <dt><a name="index-_005f_005ffixtfsi"></a>Runtime Function: <em>int</em> <strong>__fixtfsi</strong> <em>(long double <var>a</var>)</em></dt>
  149. <dt><a name="index-_005f_005ffixxfsi"></a>Runtime Function: <em>int</em> <strong>__fixxfsi</strong> <em>(long double <var>a</var>)</em></dt>
  150. <dd><p>These functions convert <var>a</var> to a signed integer, rounding toward zero.
  151. </p></dd></dl>
  152. <dl>
  153. <dt><a name="index-_005f_005ffixsfdi"></a>Runtime Function: <em>long</em> <strong>__fixsfdi</strong> <em>(float <var>a</var>)</em></dt>
  154. <dt><a name="index-_005f_005ffixdfdi"></a>Runtime Function: <em>long</em> <strong>__fixdfdi</strong> <em>(double <var>a</var>)</em></dt>
  155. <dt><a name="index-_005f_005ffixtfdi"></a>Runtime Function: <em>long</em> <strong>__fixtfdi</strong> <em>(long double <var>a</var>)</em></dt>
  156. <dt><a name="index-_005f_005ffixxfdi"></a>Runtime Function: <em>long</em> <strong>__fixxfdi</strong> <em>(long double <var>a</var>)</em></dt>
  157. <dd><p>These functions convert <var>a</var> to a signed long, rounding toward zero.
  158. </p></dd></dl>
  159. <dl>
  160. <dt><a name="index-_005f_005ffixsfti"></a>Runtime Function: <em>long long</em> <strong>__fixsfti</strong> <em>(float <var>a</var>)</em></dt>
  161. <dt><a name="index-_005f_005ffixdfti"></a>Runtime Function: <em>long long</em> <strong>__fixdfti</strong> <em>(double <var>a</var>)</em></dt>
  162. <dt><a name="index-_005f_005ffixtfti"></a>Runtime Function: <em>long long</em> <strong>__fixtfti</strong> <em>(long double <var>a</var>)</em></dt>
  163. <dt><a name="index-_005f_005ffixxfti"></a>Runtime Function: <em>long long</em> <strong>__fixxfti</strong> <em>(long double <var>a</var>)</em></dt>
  164. <dd><p>These functions convert <var>a</var> to a signed long long, rounding toward zero.
  165. </p></dd></dl>
  166. <dl>
  167. <dt><a name="index-_005f_005ffixunssfsi"></a>Runtime Function: <em>unsigned int</em> <strong>__fixunssfsi</strong> <em>(float <var>a</var>)</em></dt>
  168. <dt><a name="index-_005f_005ffixunsdfsi"></a>Runtime Function: <em>unsigned int</em> <strong>__fixunsdfsi</strong> <em>(double <var>a</var>)</em></dt>
  169. <dt><a name="index-_005f_005ffixunstfsi"></a>Runtime Function: <em>unsigned int</em> <strong>__fixunstfsi</strong> <em>(long double <var>a</var>)</em></dt>
  170. <dt><a name="index-_005f_005ffixunsxfsi"></a>Runtime Function: <em>unsigned int</em> <strong>__fixunsxfsi</strong> <em>(long double <var>a</var>)</em></dt>
  171. <dd><p>These functions convert <var>a</var> to an unsigned integer, rounding
  172. toward zero. Negative values all become zero.
  173. </p></dd></dl>
  174. <dl>
  175. <dt><a name="index-_005f_005ffixunssfdi"></a>Runtime Function: <em>unsigned long</em> <strong>__fixunssfdi</strong> <em>(float <var>a</var>)</em></dt>
  176. <dt><a name="index-_005f_005ffixunsdfdi"></a>Runtime Function: <em>unsigned long</em> <strong>__fixunsdfdi</strong> <em>(double <var>a</var>)</em></dt>
  177. <dt><a name="index-_005f_005ffixunstfdi"></a>Runtime Function: <em>unsigned long</em> <strong>__fixunstfdi</strong> <em>(long double <var>a</var>)</em></dt>
  178. <dt><a name="index-_005f_005ffixunsxfdi"></a>Runtime Function: <em>unsigned long</em> <strong>__fixunsxfdi</strong> <em>(long double <var>a</var>)</em></dt>
  179. <dd><p>These functions convert <var>a</var> to an unsigned long, rounding
  180. toward zero. Negative values all become zero.
  181. </p></dd></dl>
  182. <dl>
  183. <dt><a name="index-_005f_005ffixunssfti"></a>Runtime Function: <em>unsigned long long</em> <strong>__fixunssfti</strong> <em>(float <var>a</var>)</em></dt>
  184. <dt><a name="index-_005f_005ffixunsdfti"></a>Runtime Function: <em>unsigned long long</em> <strong>__fixunsdfti</strong> <em>(double <var>a</var>)</em></dt>
  185. <dt><a name="index-_005f_005ffixunstfti"></a>Runtime Function: <em>unsigned long long</em> <strong>__fixunstfti</strong> <em>(long double <var>a</var>)</em></dt>
  186. <dt><a name="index-_005f_005ffixunsxfti"></a>Runtime Function: <em>unsigned long long</em> <strong>__fixunsxfti</strong> <em>(long double <var>a</var>)</em></dt>
  187. <dd><p>These functions convert <var>a</var> to an unsigned long long, rounding
  188. toward zero. Negative values all become zero.
  189. </p></dd></dl>
  190. <dl>
  191. <dt><a name="index-_005f_005ffloatsisf"></a>Runtime Function: <em>float</em> <strong>__floatsisf</strong> <em>(int <var>i</var>)</em></dt>
  192. <dt><a name="index-_005f_005ffloatsidf"></a>Runtime Function: <em>double</em> <strong>__floatsidf</strong> <em>(int <var>i</var>)</em></dt>
  193. <dt><a name="index-_005f_005ffloatsitf"></a>Runtime Function: <em>long double</em> <strong>__floatsitf</strong> <em>(int <var>i</var>)</em></dt>
  194. <dt><a name="index-_005f_005ffloatsixf"></a>Runtime Function: <em>long double</em> <strong>__floatsixf</strong> <em>(int <var>i</var>)</em></dt>
  195. <dd><p>These functions convert <var>i</var>, a signed integer, to floating point.
  196. </p></dd></dl>
  197. <dl>
  198. <dt><a name="index-_005f_005ffloatdisf"></a>Runtime Function: <em>float</em> <strong>__floatdisf</strong> <em>(long <var>i</var>)</em></dt>
  199. <dt><a name="index-_005f_005ffloatdidf"></a>Runtime Function: <em>double</em> <strong>__floatdidf</strong> <em>(long <var>i</var>)</em></dt>
  200. <dt><a name="index-_005f_005ffloatditf"></a>Runtime Function: <em>long double</em> <strong>__floatditf</strong> <em>(long <var>i</var>)</em></dt>
  201. <dt><a name="index-_005f_005ffloatdixf"></a>Runtime Function: <em>long double</em> <strong>__floatdixf</strong> <em>(long <var>i</var>)</em></dt>
  202. <dd><p>These functions convert <var>i</var>, a signed long, to floating point.
  203. </p></dd></dl>
  204. <dl>
  205. <dt><a name="index-_005f_005ffloattisf"></a>Runtime Function: <em>float</em> <strong>__floattisf</strong> <em>(long long <var>i</var>)</em></dt>
  206. <dt><a name="index-_005f_005ffloattidf"></a>Runtime Function: <em>double</em> <strong>__floattidf</strong> <em>(long long <var>i</var>)</em></dt>
  207. <dt><a name="index-_005f_005ffloattitf"></a>Runtime Function: <em>long double</em> <strong>__floattitf</strong> <em>(long long <var>i</var>)</em></dt>
  208. <dt><a name="index-_005f_005ffloattixf"></a>Runtime Function: <em>long double</em> <strong>__floattixf</strong> <em>(long long <var>i</var>)</em></dt>
  209. <dd><p>These functions convert <var>i</var>, a signed long long, to floating point.
  210. </p></dd></dl>
  211. <dl>
  212. <dt><a name="index-_005f_005ffloatunsisf"></a>Runtime Function: <em>float</em> <strong>__floatunsisf</strong> <em>(unsigned int <var>i</var>)</em></dt>
  213. <dt><a name="index-_005f_005ffloatunsidf"></a>Runtime Function: <em>double</em> <strong>__floatunsidf</strong> <em>(unsigned int <var>i</var>)</em></dt>
  214. <dt><a name="index-_005f_005ffloatunsitf"></a>Runtime Function: <em>long double</em> <strong>__floatunsitf</strong> <em>(unsigned int <var>i</var>)</em></dt>
  215. <dt><a name="index-_005f_005ffloatunsixf"></a>Runtime Function: <em>long double</em> <strong>__floatunsixf</strong> <em>(unsigned int <var>i</var>)</em></dt>
  216. <dd><p>These functions convert <var>i</var>, an unsigned integer, to floating point.
  217. </p></dd></dl>
  218. <dl>
  219. <dt><a name="index-_005f_005ffloatundisf"></a>Runtime Function: <em>float</em> <strong>__floatundisf</strong> <em>(unsigned long <var>i</var>)</em></dt>
  220. <dt><a name="index-_005f_005ffloatundidf"></a>Runtime Function: <em>double</em> <strong>__floatundidf</strong> <em>(unsigned long <var>i</var>)</em></dt>
  221. <dt><a name="index-_005f_005ffloatunditf"></a>Runtime Function: <em>long double</em> <strong>__floatunditf</strong> <em>(unsigned long <var>i</var>)</em></dt>
  222. <dt><a name="index-_005f_005ffloatundixf"></a>Runtime Function: <em>long double</em> <strong>__floatundixf</strong> <em>(unsigned long <var>i</var>)</em></dt>
  223. <dd><p>These functions convert <var>i</var>, an unsigned long, to floating point.
  224. </p></dd></dl>
  225. <dl>
  226. <dt><a name="index-_005f_005ffloatuntisf"></a>Runtime Function: <em>float</em> <strong>__floatuntisf</strong> <em>(unsigned long long <var>i</var>)</em></dt>
  227. <dt><a name="index-_005f_005ffloatuntidf"></a>Runtime Function: <em>double</em> <strong>__floatuntidf</strong> <em>(unsigned long long <var>i</var>)</em></dt>
  228. <dt><a name="index-_005f_005ffloatuntitf"></a>Runtime Function: <em>long double</em> <strong>__floatuntitf</strong> <em>(unsigned long long <var>i</var>)</em></dt>
  229. <dt><a name="index-_005f_005ffloatuntixf"></a>Runtime Function: <em>long double</em> <strong>__floatuntixf</strong> <em>(unsigned long long <var>i</var>)</em></dt>
  230. <dd><p>These functions convert <var>i</var>, an unsigned long long, to floating point.
  231. </p></dd></dl>
  232. <a name="Comparison-functions-1"></a>
  233. <h4 class="subsection">4.2.3 Comparison functions</h4>
  234. <p>There are two sets of basic comparison functions.
  235. </p>
  236. <dl>
  237. <dt><a name="index-_005f_005fcmpsf2"></a>Runtime Function: <em>int</em> <strong>__cmpsf2</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  238. <dt><a name="index-_005f_005fcmpdf2"></a>Runtime Function: <em>int</em> <strong>__cmpdf2</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  239. <dt><a name="index-_005f_005fcmptf2"></a>Runtime Function: <em>int</em> <strong>__cmptf2</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  240. <dd><p>These functions calculate <em>a &lt;=&gt; b</em>. That is, if <var>a</var> is less
  241. than <var>b</var>, they return -1; if <var>a</var> is greater than <var>b</var>, they
  242. return 1; and if <var>a</var> and <var>b</var> are equal they return 0. If
  243. either argument is NaN they return 1, but you should not rely on this;
  244. if NaN is a possibility, use one of the higher-level comparison
  245. functions.
  246. </p></dd></dl>
  247. <dl>
  248. <dt><a name="index-_005f_005funordsf2"></a>Runtime Function: <em>int</em> <strong>__unordsf2</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  249. <dt><a name="index-_005f_005funorddf2"></a>Runtime Function: <em>int</em> <strong>__unorddf2</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  250. <dt><a name="index-_005f_005funordtf2"></a>Runtime Function: <em>int</em> <strong>__unordtf2</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  251. <dd><p>These functions return a nonzero value if either argument is NaN, otherwise 0.
  252. </p></dd></dl>
  253. <p>There is also a complete group of higher level functions which
  254. correspond directly to comparison operators. They implement the ISO C
  255. semantics for floating-point comparisons, taking NaN into account.
  256. Pay careful attention to the return values defined for each set.
  257. Under the hood, all of these routines are implemented as
  258. </p>
  259. <div class="smallexample">
  260. <pre class="smallexample"> if (__unord<var>X</var>f2 (a, b))
  261. return <var>E</var>;
  262. return __cmp<var>X</var>f2 (a, b);
  263. </pre></div>
  264. <p>where <var>E</var> is a constant chosen to give the proper behavior for
  265. NaN. Thus, the meaning of the return value is different for each set.
  266. Do not rely on this implementation; only the semantics documented
  267. below are guaranteed.
  268. </p>
  269. <dl>
  270. <dt><a name="index-_005f_005feqsf2"></a>Runtime Function: <em>int</em> <strong>__eqsf2</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  271. <dt><a name="index-_005f_005feqdf2"></a>Runtime Function: <em>int</em> <strong>__eqdf2</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  272. <dt><a name="index-_005f_005feqtf2"></a>Runtime Function: <em>int</em> <strong>__eqtf2</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  273. <dd><p>These functions return zero if neither argument is NaN, and <var>a</var> and
  274. <var>b</var> are equal.
  275. </p></dd></dl>
  276. <dl>
  277. <dt><a name="index-_005f_005fnesf2"></a>Runtime Function: <em>int</em> <strong>__nesf2</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  278. <dt><a name="index-_005f_005fnedf2"></a>Runtime Function: <em>int</em> <strong>__nedf2</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  279. <dt><a name="index-_005f_005fnetf2"></a>Runtime Function: <em>int</em> <strong>__netf2</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  280. <dd><p>These functions return a nonzero value if either argument is NaN, or
  281. if <var>a</var> and <var>b</var> are unequal.
  282. </p></dd></dl>
  283. <dl>
  284. <dt><a name="index-_005f_005fgesf2"></a>Runtime Function: <em>int</em> <strong>__gesf2</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  285. <dt><a name="index-_005f_005fgedf2"></a>Runtime Function: <em>int</em> <strong>__gedf2</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  286. <dt><a name="index-_005f_005fgetf2"></a>Runtime Function: <em>int</em> <strong>__getf2</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  287. <dd><p>These functions return a value greater than or equal to zero if
  288. neither argument is NaN, and <var>a</var> is greater than or equal to
  289. <var>b</var>.
  290. </p></dd></dl>
  291. <dl>
  292. <dt><a name="index-_005f_005fltsf2"></a>Runtime Function: <em>int</em> <strong>__ltsf2</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  293. <dt><a name="index-_005f_005fltdf2"></a>Runtime Function: <em>int</em> <strong>__ltdf2</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  294. <dt><a name="index-_005f_005flttf2"></a>Runtime Function: <em>int</em> <strong>__lttf2</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  295. <dd><p>These functions return a value less than zero if neither argument is
  296. NaN, and <var>a</var> is strictly less than <var>b</var>.
  297. </p></dd></dl>
  298. <dl>
  299. <dt><a name="index-_005f_005flesf2"></a>Runtime Function: <em>int</em> <strong>__lesf2</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  300. <dt><a name="index-_005f_005fledf2"></a>Runtime Function: <em>int</em> <strong>__ledf2</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  301. <dt><a name="index-_005f_005fletf2"></a>Runtime Function: <em>int</em> <strong>__letf2</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  302. <dd><p>These functions return a value less than or equal to zero if neither
  303. argument is NaN, and <var>a</var> is less than or equal to <var>b</var>.
  304. </p></dd></dl>
  305. <dl>
  306. <dt><a name="index-_005f_005fgtsf2"></a>Runtime Function: <em>int</em> <strong>__gtsf2</strong> <em>(float <var>a</var>, float <var>b</var>)</em></dt>
  307. <dt><a name="index-_005f_005fgtdf2"></a>Runtime Function: <em>int</em> <strong>__gtdf2</strong> <em>(double <var>a</var>, double <var>b</var>)</em></dt>
  308. <dt><a name="index-_005f_005fgttf2"></a>Runtime Function: <em>int</em> <strong>__gttf2</strong> <em>(long double <var>a</var>, long double <var>b</var>)</em></dt>
  309. <dd><p>These functions return a value greater than zero if neither argument
  310. is NaN, and <var>a</var> is strictly greater than <var>b</var>.
  311. </p></dd></dl>
  312. <a name="Other-floating_002dpoint-functions"></a>
  313. <h4 class="subsection">4.2.4 Other floating-point functions</h4>
  314. <dl>
  315. <dt><a name="index-_005f_005fpowisf2"></a>Runtime Function: <em>float</em> <strong>__powisf2</strong> <em>(float <var>a</var>, int <var>b</var>)</em></dt>
  316. <dt><a name="index-_005f_005fpowidf2"></a>Runtime Function: <em>double</em> <strong>__powidf2</strong> <em>(double <var>a</var>, int <var>b</var>)</em></dt>
  317. <dt><a name="index-_005f_005fpowitf2"></a>Runtime Function: <em>long double</em> <strong>__powitf2</strong> <em>(long double <var>a</var>, int <var>b</var>)</em></dt>
  318. <dt><a name="index-_005f_005fpowixf2"></a>Runtime Function: <em>long double</em> <strong>__powixf2</strong> <em>(long double <var>a</var>, int <var>b</var>)</em></dt>
  319. <dd><p>These functions convert raise <var>a</var> to the power <var>b</var>.
  320. </p></dd></dl>
  321. <dl>
  322. <dt><a name="index-_005f_005fmulsc3"></a>Runtime Function: <em>complex float</em> <strong>__mulsc3</strong> <em>(float <var>a</var>, float <var>b</var>, float <var>c</var>, float <var>d</var>)</em></dt>
  323. <dt><a name="index-_005f_005fmuldc3"></a>Runtime Function: <em>complex double</em> <strong>__muldc3</strong> <em>(double <var>a</var>, double <var>b</var>, double <var>c</var>, double <var>d</var>)</em></dt>
  324. <dt><a name="index-_005f_005fmultc3"></a>Runtime Function: <em>complex long double</em> <strong>__multc3</strong> <em>(long double <var>a</var>, long double <var>b</var>, long double <var>c</var>, long double <var>d</var>)</em></dt>
  325. <dt><a name="index-_005f_005fmulxc3"></a>Runtime Function: <em>complex long double</em> <strong>__mulxc3</strong> <em>(long double <var>a</var>, long double <var>b</var>, long double <var>c</var>, long double <var>d</var>)</em></dt>
  326. <dd><p>These functions return the product of <em><var>a</var> + i<var>b</var></em> and
  327. <em><var>c</var> + i<var>d</var></em>, following the rules of C99 Annex G.
  328. </p></dd></dl>
  329. <dl>
  330. <dt><a name="index-_005f_005fdivsc3"></a>Runtime Function: <em>complex float</em> <strong>__divsc3</strong> <em>(float <var>a</var>, float <var>b</var>, float <var>c</var>, float <var>d</var>)</em></dt>
  331. <dt><a name="index-_005f_005fdivdc3"></a>Runtime Function: <em>complex double</em> <strong>__divdc3</strong> <em>(double <var>a</var>, double <var>b</var>, double <var>c</var>, double <var>d</var>)</em></dt>
  332. <dt><a name="index-_005f_005fdivtc3"></a>Runtime Function: <em>complex long double</em> <strong>__divtc3</strong> <em>(long double <var>a</var>, long double <var>b</var>, long double <var>c</var>, long double <var>d</var>)</em></dt>
  333. <dt><a name="index-_005f_005fdivxc3"></a>Runtime Function: <em>complex long double</em> <strong>__divxc3</strong> <em>(long double <var>a</var>, long double <var>b</var>, long double <var>c</var>, long double <var>d</var>)</em></dt>
  334. <dd><p>These functions return the quotient of <em><var>a</var> + i<var>b</var></em> and
  335. <em><var>c</var> + i<var>d</var></em> (i.e., <em>(<var>a</var> + i<var>b</var>) / (<var>c</var>
  336. + i<var>d</var>)</em>), following the rules of C99 Annex G.
  337. </p></dd></dl>
  338. <hr>
  339. <div class="header">
  340. <p>
  341. Next: <a href="Decimal-float-library-routines.html#Decimal-float-library-routines" accesskey="n" rel="next">Decimal float library routines</a>, Previous: <a href="Integer-library-routines.html#Integer-library-routines" accesskey="p" rel="prev">Integer library routines</a>, Up: <a href="Libgcc.html#Libgcc" accesskey="u" rel="up">Libgcc</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  342. </div>
  343. </body>
  344. </html>