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

sin.3p (4225B)


  1. '\" et
  2. .TH SIN "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. sin,
  12. sinf,
  13. sinl
  14. \(em sine function
  15. .SH SYNOPSIS
  16. .LP
  17. .nf
  18. #include <math.h>
  19. .P
  20. double sin(double \fIx\fP);
  21. float sinf(float \fIx\fP);
  22. long double sinl(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 compute the sine of their argument
  30. .IR x ,
  31. measured in radians.
  32. .P
  33. An application wishing to check for error situations should set
  34. .IR errno
  35. to zero and call
  36. .IR feclearexcept (FE_ALL_EXCEPT)
  37. before calling these functions. On return, if
  38. .IR errno
  39. is non-zero or \fIfetestexcept\fR(FE_INVALID | FE_DIVBYZERO |
  40. FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has occurred.
  41. .SH "RETURN VALUE"
  42. Upon successful completion, these functions shall return the sine of
  43. .IR x .
  44. .P
  45. If
  46. .IR x
  47. is NaN, a NaN shall be returned.
  48. .P
  49. If
  50. .IR x
  51. is \(+-0,
  52. .IR x
  53. shall be returned.
  54. .P
  55. If
  56. .IR x
  57. is subnormal, a range error may occur
  58. .br
  59. and
  60. .IR x
  61. should be returned.
  62. .P
  63. If
  64. .IR x
  65. is not returned,
  66. \fIsin\fR(),
  67. \fIsinf\fR(),
  68. and
  69. \fIsinl\fR()
  70. shall return an implementation-defined value no greater in magnitude
  71. than DBL_MIN, FLT_MIN, and LDBL_MIN, respectively.
  72. .P
  73. If
  74. .IR x
  75. is \(+-Inf, a domain error shall occur, and a NaN shall be returned.
  76. .SH ERRORS
  77. These functions shall fail if:
  78. .IP "Domain\ Error" 12
  79. The
  80. .IR x
  81. argument is \(+-Inf.
  82. .RS 12
  83. .P
  84. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  85. non-zero, then
  86. .IR errno
  87. shall be set to
  88. .BR [EDOM] .
  89. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  90. non-zero, then the invalid floating-point exception shall be raised.
  91. .RE
  92. .P
  93. These functions may fail if:
  94. .IP "Range\ Error" 12
  95. The value of
  96. .IR x
  97. is subnormal
  98. .RS 12
  99. .P
  100. If the integer expression (\fImath_errhandling\fR & MATH_ERRNO) is
  101. non-zero, then
  102. .IR errno
  103. shall be set to
  104. .BR [ERANGE] .
  105. If the integer expression (\fImath_errhandling\fR & MATH_ERREXCEPT) is
  106. non-zero, then the underflow floating-point exception shall be raised.
  107. .RE
  108. .LP
  109. .IR "The following sections are informative."
  110. .SH EXAMPLES
  111. .SS "Taking the Sine of a 45-Degree Angle"
  112. .sp
  113. .RS 4
  114. .nf
  115. #include <math.h>
  116. \&...
  117. double radians = 45.0 * M_PI / 180;
  118. double result;
  119. \&...
  120. result = sin(radians);
  121. .fi
  122. .P
  123. .RE
  124. .SH "APPLICATION USAGE"
  125. These functions may lose accuracy when their argument is near a
  126. multiple of \(*p or is far from 0.0.
  127. .P
  128. On error, the expressions (\fImath_errhandling\fR & MATH_ERRNO) and
  129. (\fImath_errhandling\fR & MATH_ERREXCEPT) are independent of each
  130. other, but at least one of them must be non-zero.
  131. .SH RATIONALE
  132. None.
  133. .SH "FUTURE DIRECTIONS"
  134. None.
  135. .SH "SEE ALSO"
  136. .IR "\fIasin\fR\^(\|)",
  137. .IR "\fIfeclearexcept\fR\^(\|)",
  138. .IR "\fIfetestexcept\fR\^(\|)",
  139. .IR "\fIisnan\fR\^(\|)"
  140. .P
  141. The Base Definitions volume of POSIX.1\(hy2017,
  142. .IR "Section 4.20" ", " "Treatment of Error Conditions for Mathematical Functions",
  143. .IR "\fB<math.h>\fP"
  144. .\"
  145. .SH COPYRIGHT
  146. Portions of this text are reprinted and reproduced in electronic form
  147. from IEEE Std 1003.1-2017, Standard for Information Technology
  148. -- Portable Operating System Interface (POSIX), The Open Group Base
  149. Specifications Issue 7, 2018 Edition,
  150. Copyright (C) 2018 by the Institute of
  151. Electrical and Electronics Engineers, Inc and The Open Group.
  152. In the event of any discrepancy between this version and the original IEEE and
  153. The Open Group Standard, the original IEEE and The Open Group Standard
  154. is the referee document. The original Standard can be obtained online at
  155. http://www.opengroup.org/unix/online.html .
  156. .PP
  157. Any typographical or formatting errors that appear
  158. in this page are most likely
  159. to have been introduced during the conversion of the source files to
  160. man page format. To report such errors, see
  161. https://www.kernel.org/doc/man-pages/reporting_bugs.html .