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

round.3p (2909B)


  1. '\" et
  2. .TH ROUND "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. round,
  12. roundf,
  13. roundl
  14. \(em round to the nearest integer value in a floating-point format
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <math.h>
  19. .P
  20. double round(double \fIx\fP);
  21. float roundf(float \fIx\fP);
  22. long double roundl(long double \fIx\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 round their argument to the nearest integer value
  30. in floating-point format, rounding halfway cases away from zero,
  31. regardless of the current rounding direction.
  32. .SH "RETURN VALUE"
  33. Upon successful completion, these functions shall return the rounded
  34. integer value.
  35. The result shall have the same sign as
  36. .IR x .
  37. .P
  38. If
  39. .IR x
  40. is NaN, a NaN shall be returned.
  41. .P
  42. If
  43. .IR x
  44. is \(+-0 or \(+-Inf,
  45. .IR x
  46. shall be returned.
  47. .SH ERRORS
  48. No errors are defined.
  49. .LP
  50. .IR "The following sections are informative."
  51. .SH EXAMPLES
  52. None.
  53. .SH "APPLICATION USAGE"
  54. The integral value returned by these functions need not be expressible
  55. as an
  56. .BR intmax_t .
  57. The return value should be tested before assigning it to an integer
  58. type to avoid the undefined results of an integer overflow.
  59. .P
  60. These functions may raise the inexact floating-point exception if the
  61. result differs in value from the argument.
  62. .SH RATIONALE
  63. None.
  64. .SH "FUTURE DIRECTIONS"
  65. None.
  66. .SH "SEE ALSO"
  67. .IR "\fIfeclearexcept\fR\^(\|)",
  68. .IR "\fIfetestexcept\fR\^(\|)"
  69. .P
  70. The Base Definitions volume of POSIX.1\(hy2017,
  71. .IR "Section 4.20" ", " "Treatment of Error Conditions for Mathematical Functions",
  72. .IR "\fB<math.h>\fP"
  73. .\"
  74. .SH COPYRIGHT
  75. Portions of this text are reprinted and reproduced in electronic form
  76. from IEEE Std 1003.1-2017, Standard for Information Technology
  77. -- Portable Operating System Interface (POSIX), The Open Group Base
  78. Specifications Issue 7, 2018 Edition,
  79. Copyright (C) 2018 by the Institute of
  80. Electrical and Electronics Engineers, Inc and The Open Group.
  81. In the event of any discrepancy between this version and the original IEEE and
  82. The Open Group Standard, the original IEEE and The Open Group Standard
  83. is the referee document. The original Standard can be obtained online at
  84. http://www.opengroup.org/unix/online.html .
  85. .PP
  86. Any typographical or formatting errors that appear
  87. in this page are most likely
  88. to have been introduced during the conversion of the source files to
  89. man page format. To report such errors, see
  90. https://www.kernel.org/doc/man-pages/reporting_bugs.html .