]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
93207036 MK |
2 | .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk |
3 | .\" <mtk.manpages@gmail.com> | |
fea681da | 4 | .\" |
93015253 | 5 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
6 | .\" Permission is granted to make and distribute verbatim copies of this |
7 | .\" manual provided the copyright notice and this permission notice are | |
8 | .\" preserved on all copies. | |
9 | .\" | |
10 | .\" Permission is granted to copy and distribute modified versions of this | |
11 | .\" manual under the conditions for verbatim copying, provided that the | |
12 | .\" entire resulting derived work is distributed under the terms of a | |
13 | .\" permission notice identical to this one. | |
c13182ef | 14 | .\" |
fea681da MK |
15 | .\" Since the Linux kernel and libraries are constantly changing, this |
16 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
17 | .\" responsibility for errors or omissions, or for damages resulting from | |
18 | .\" the use of the information contained herein. The author(s) may not | |
19 | .\" have taken the same level of care in the production of this manual, | |
20 | .\" which is licensed free of charge, as they might when working | |
21 | .\" professionally. | |
c13182ef | 22 | .\" |
fea681da MK |
23 | .\" Formatted or processed versions of this manual, if unaccompanied by |
24 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 25 | .\" %%%LICENSE_END |
fea681da MK |
26 | .\" |
27 | .\" References consulted: | |
28 | .\" Linux libc source code | |
29 | .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) | |
30 | .\" 386BSD man pages | |
31 | .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) | |
32 | .\" Modified 2002-07-27 by Walter Harms | |
33 | .\" (walter.harms@informatik.uni-oldenburg.de) | |
7848c0dc | 34 | .\" |
c73595c2 | 35 | .TH SIN 3 2015-04-19 "" "Linux Programmer's Manual" |
fea681da MK |
36 | .SH NAME |
37 | sin, sinf, sinl \- sine function | |
38 | .SH SYNOPSIS | |
39 | .nf | |
40 | .B #include <math.h> | |
41 | .sp | |
42 | .BI "double sin(double " x ); | |
d39541ec | 43 | .br |
fea681da | 44 | .BI "float sinf(float " x ); |
d39541ec | 45 | .br |
fea681da MK |
46 | .BI "long double sinl(long double " x ); |
47 | .fi | |
48 | .sp | |
20c58d70 | 49 | Link with \fI\-lm\fP. |
93207036 MK |
50 | .sp |
51 | .in -4n | |
52 | Feature Test Macro Requirements for glibc (see | |
53 | .BR feature_test_macros (7)): | |
54 | .in | |
55 | .sp | |
56 | .ad l | |
57 | .BR sinf (), | |
58 | .BR sinl (): | |
b90c43a8 | 59 | .RS 4 |
e464f054 MK |
60 | _BSD_SOURCE || _SVID_SOURCE || _ISOC99_SOURCE || |
61 | _POSIX_C_SOURCE\ >=\ 200112L | |
b90c43a8 MK |
62 | .br |
63 | or | |
93207036 | 64 | .I cc\ -std=c99 |
b90c43a8 MK |
65 | .RE |
66 | .ad | |
fea681da | 67 | .SH DESCRIPTION |
5600f73a | 68 | These functions return the sine of |
022671eb MK |
69 | .IR x , |
70 | where | |
71 | .I x | |
72 | is | |
fea681da | 73 | given in radians. |
93207036 MK |
74 | .SH RETURN VALUE |
75 | On success, these functions return the sine of | |
76 | .IR x . | |
77 | ||
78 | If | |
79 | .I x | |
80 | is a NaN, a NaN is returned. | |
81 | ||
82 | If | |
83 | .I x | |
84 | is positive infinity or negative infinity, | |
efe294cb | 85 | a domain error occurs, |
93207036 MK |
86 | and a NaN is returned. |
87 | .\" | |
88 | .\" POSIX.1 allows an optional range error for subnormal x | |
89 | .\" glibc 2.8 doesn't do this | |
90 | .SH ERRORS | |
91 | See | |
92 | .BR math_error (7) | |
93 | for information on how to determine whether an error has occurred | |
94 | when calling these functions. | |
95 | .PP | |
96 | The following errors can occur: | |
97 | .TP | |
98 | Domain error: \fIx\fP is an infinity | |
7848c0dc MK |
99 | .I errno |
100 | is set to | |
101 | .BR EDOM | |
102 | (but see BUGS). | |
93207036 MK |
103 | An invalid floating-point exception |
104 | .RB ( FE_INVALID ) | |
105 | is raised. | |
8cceed69 | 106 | .SH ATTRIBUTES |
df3ccbc4 PH |
107 | For an explanation of the terms used in this section, see |
108 | .BR attributes (7). | |
109 | .TS | |
110 | allbox; | |
111 | lbw21 lb lb | |
112 | l l l. | |
113 | Interface Attribute Value | |
114 | T{ | |
8cceed69 PH |
115 | .BR sin (), |
116 | .BR sinf (), | |
8cceed69 | 117 | .BR sinl () |
df3ccbc4 PH |
118 | T} Thread safety MT-Safe |
119 | .TE | |
47297adb | 120 | .SH CONFORMING TO |
9a74e018 | 121 | C99, POSIX.1-2001, POSIX.1-2008. |
e05e3635 | 122 | |
93207036 MK |
123 | The variant returning |
124 | .I double | |
125 | also conforms to | |
68e1685c | 126 | SVr4, 4.3BSD, C89. |
7848c0dc MK |
127 | .SH BUGS |
128 | Before version 2.10, the glibc implementation did not set | |
129 | .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6781 | |
130 | .I errno | |
131 | to | |
132 | .B EDOM | |
133 | when a domain error occurred. | |
47297adb | 134 | .SH SEE ALSO |
fea681da MK |
135 | .BR acos (3), |
136 | .BR asin (3), | |
137 | .BR atan (3), | |
138 | .BR atan2 (3), | |
139 | .BR cos (3), | |
f0c34053 | 140 | .BR csin (3), |
baf17bc4 | 141 | .BR sincos (3), |
fea681da | 142 | .BR tan (3) |