]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de) |
2 | .\" Distributed under GPL, 2002-07-27 Walter Harms | |
48dabc90 MK |
3 | .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk |
4 | .\" <mtk.manpages@gmail.com> | |
fea681da | 5 | .\" |
f0d7ce1d | 6 | .TH SINCOS 3 2008-08-11 "GNU" "Linux Programmer's Manual" |
fea681da MK |
7 | .SH NAME |
8 | sincos, sincosf, sincosl \- calculate sin and cos simultaneously | |
9 | .SH SYNOPSIS | |
10 | .nf | |
b80f966b | 11 | .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
fea681da MK |
12 | .B #include <math.h> |
13 | .sp | |
14 | .BI "void sincos(double " x ", double *" sin ", double *" cos ); | |
d39541ec | 15 | .br |
fea681da | 16 | .BI "void sincosf(float " x ", float *" sin ", float *" cos ); |
d39541ec | 17 | .br |
fea681da MK |
18 | .BI "void sincosl(long double " x ", long double *" sin ", long double *" cos ); |
19 | .fi | |
20 | .sp | |
20c58d70 | 21 | Link with \fI\-lm\fP. |
fea681da MK |
22 | .SH DESCRIPTION |
23 | Several applications need sine and cosine of the same angle | |
24 | .IR x . | |
48dabc90 MK |
25 | This function computes both at the same time, and stores the results in |
26 | .I *sin | |
27 | and | |
28 | .IR *cos . | |
29 | ||
30 | If | |
31 | .I x | |
32 | is a NaN, | |
33 | a NaN is returned in | |
34 | .I *sin | |
35 | and | |
36 | .IR *cos . | |
37 | ||
38 | If | |
39 | .I x | |
40 | is positive infinity or negative infinity, | |
efe294cb | 41 | a domain error occurs, and |
48dabc90 MK |
42 | a NaN is returned in |
43 | .I *sin | |
44 | and | |
45 | .IR *cos . | |
46 | .SH RETURN VALUE | |
47 | These functions return | |
48 | .IR void . | |
49 | .SH ERRORS | |
50 | See | |
51 | .BR math_error (7) | |
52 | for information on how to determine whether an error has occurred | |
53 | when calling these functions. | |
54 | .PP | |
55 | The following errors can occur: | |
56 | .TP | |
57 | Domain error: \fIx\fP is an infinity | |
58 | .\" .I errno | |
59 | .\" is set to | |
60 | .\" .BR EDOM . | |
61 | An invalid floating-point exception | |
62 | .RB ( FE_INVALID ) | |
63 | is raised. | |
64 | .PP | |
65 | These functions do not set | |
66 | .IR errno . | |
67 | .\" FIXME . Is it intentional that these functions do not set errno? | |
68 | .\" sin() and cos() also don't set errno; bugs have been raised for | |
69 | .\" those functions. | |
f0d7ce1d MK |
70 | .SH VERSIONS |
71 | These functions first appeared in glibc in version 2.1. | |
fea681da MK |
72 | .SH "CONFORMING TO" |
73 | This function is a GNU extension. | |
74 | .SH "SEE ALSO" | |
75 | .BR cos (3), | |
76 | .BR sin (3), | |
0a90178c MK |
77 | .BR tan (3), |
78 | .BR feature_test_macros (7) |