logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

modf.3p (2937B)


  1. '\" et
  2. .TH MODF "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. modf,
  12. modff,
  13. modfl
  14. \(em decompose a floating-point number
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <math.h>
  19. .P
  20. double modf(double \fIx\fP, double *\fIiptr\fP);
  21. float modff(float \fIvalue\fP, float *\fIiptr\fP);
  22. long double modfl(long double \fIvalue\fP, long double *\fIiptr\fP);
  23. .fi
  24. .SH DESCRIPTION
  25. The functionality described on this reference page is aligned with the
  26. ISO\ C standard. Any conflict between the requirements described here and the
  27. ISO\ C standard is unintentional. This volume of POSIX.1\(hy2017 defers to the ISO\ C standard.
  28. .P
  29. These functions shall break the argument
  30. .IR x
  31. into integral and fractional parts, each of which has the same sign as
  32. the argument. It stores the integral part as a
  33. .BR double
  34. (for the
  35. \fImodf\fR()
  36. function), a
  37. .BR float
  38. (for the
  39. \fImodff\fR()
  40. function), or a
  41. .BR "long double"
  42. (for the
  43. \fImodfl\fR()
  44. function), in the object pointed to by
  45. .IR iptr .
  46. .SH "RETURN VALUE"
  47. Upon successful completion, these functions shall return the signed
  48. fractional part of
  49. .IR x .
  50. .P
  51. If
  52. .IR x
  53. is NaN, a NaN shall be returned, and *\fIiptr\fP shall be set to a
  54. NaN.
  55. .P
  56. If
  57. .IR x
  58. is \(+-Inf, \(+-0 shall be returned, and *\fIiptr\fP shall be set to
  59. \(+-Inf.
  60. .SH ERRORS
  61. No errors are defined.
  62. .LP
  63. .IR "The following sections are informative."
  64. .SH EXAMPLES
  65. None.
  66. .SH "APPLICATION USAGE"
  67. The
  68. \fImodf\fR()
  69. function computes the function result and *\fIiptr\fP such that:
  70. .sp
  71. .RS 4
  72. .nf
  73. a = modf(x, iptr) ;
  74. x == a+*iptr ;
  75. .fi
  76. .P
  77. .RE
  78. .P
  79. allowing for the usual floating-point inaccuracies.
  80. .SH RATIONALE
  81. None.
  82. .SH "FUTURE DIRECTIONS"
  83. None.
  84. .SH "SEE ALSO"
  85. .IR "\fIfrexp\fR\^(\|)",
  86. .IR "\fIisnan\fR\^(\|)",
  87. .IR "\fIldexp\fR\^(\|)"
  88. .P
  89. The Base Definitions volume of POSIX.1\(hy2017,
  90. .IR "\fB<math.h>\fP"
  91. .\"
  92. .SH COPYRIGHT
  93. Portions of this text are reprinted and reproduced in electronic form
  94. from IEEE Std 1003.1-2017, Standard for Information Technology
  95. -- Portable Operating System Interface (POSIX), The Open Group Base
  96. Specifications Issue 7, 2018 Edition,
  97. Copyright (C) 2018 by the Institute of
  98. Electrical and Electronics Engineers, Inc and The Open Group.
  99. In the event of any discrepancy between this version and the original IEEE and
  100. The Open Group Standard, the original IEEE and The Open Group Standard
  101. is the referee document. The original Standard can be obtained online at
  102. http://www.opengroup.org/unix/online.html .
  103. .PP
  104. Any typographical or formatting errors that appear
  105. in this page are most likely
  106. to have been introduced during the conversion of the source files to
  107. man page format. To report such errors, see
  108. https://www.kernel.org/doc/man-pages/reporting_bugs.html .