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

trunc.3p (2744B)


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