選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

94 行
3.7KB

  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>modf (LIBM)</title>
  7. <meta name="description" content="modf (LIBM)">
  8. <meta name="keywords" content="modf (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="Math.html#Math" rel="up" title="Math">
  16. <link href="nan.html#nan" rel="next" title="nan">
  17. <link href="lround.html#lround" rel="prev" title="lround">
  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="modf"></a>
  48. <div class="header">
  49. <p>
  50. Next: <a href="nan.html#nan" accesskey="n" rel="next">nan</a>, Previous: <a href="lround.html#lround" accesskey="p" rel="prev">lround</a>, Up: <a href="Math.html#Math" accesskey="u" rel="up">Math</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="modf_002c-modff_002d_002d_002dsplit-fractional-and-integer-parts"></a>
  54. <h3 class="section">1.41 <code>modf</code>, <code>modff</code>&mdash;split fractional and integer parts</h3>
  55. <a name="index-modf"></a>
  56. <a name="index-modff"></a>
  57. <p><strong>Synopsis</strong>
  58. </p><div class="example">
  59. <pre class="example">#include &lt;math.h&gt;
  60. double modf(double <var>val</var>, double *<var>ipart</var>);
  61. float modff(float <var>val</var>, float *<var>ipart</var>);
  62. </pre></div>
  63. <p><strong>Description</strong><br>
  64. <code>modf</code> splits the double <var>val</var> apart into an integer part
  65. and a fractional part, returning the fractional part and
  66. storing the integer part in <code>*<var>ipart</var></code>. No rounding
  67. whatsoever is done; the sum of the integer and fractional
  68. parts is guaranteed to be exactly equal to <var>val</var>. That
  69. is, if <var>realpart</var> = modf(<var>val</var>, &amp;<var>intpart</var>); then
  70. &lsquo;<code><var>realpart</var>+<var>intpart</var></code>&rsquo; is the same as <var>val</var>.
  71. <code>modff</code> is identical, save that it takes and returns
  72. <code>float</code> rather than <code>double</code> values.
  73. </p>
  74. <br>
  75. <p><strong>Returns</strong><br>
  76. The fractional part is returned. Each result has the same
  77. sign as the supplied argument <var>val</var>.
  78. </p>
  79. <br>
  80. <p><strong>Portability</strong><br>
  81. <code>modf</code> is ANSI C. <code>modff</code> is an extension.
  82. </p>
  83. <br>
  84. </body>
  85. </html>