]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sincos.3
getauxval.3: wfix
[thirdparty/man-pages.git] / man3 / sincos.3
CommitLineData
fea681da 1.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
66ace94e
MK
2.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3.\" <mtk.manpages@gmail.com>
2297bf0e 4.\"
38f20bb9
MK
5.\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
6.\" Distributed under GPL
7.\" %%%LICENSE_END
fea681da 8.\"
fe0fefbf 9.TH SINCOS 3 2015-03-02 "GNU" "Linux Programmer's Manual"
fea681da
MK
10.SH NAME
11sincos, sincosf, sincosl \- calculate sin and cos simultaneously
12.SH SYNOPSIS
13.nf
b80f966b 14.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
fea681da
MK
15.B #include <math.h>
16.sp
17.BI "void sincos(double " x ", double *" sin ", double *" cos );
d39541ec 18.br
fea681da 19.BI "void sincosf(float " x ", float *" sin ", float *" cos );
d39541ec 20.br
fea681da
MK
21.BI "void sincosl(long double " x ", long double *" sin ", long double *" cos );
22.fi
23.sp
20c58d70 24Link with \fI\-lm\fP.
fea681da
MK
25.SH DESCRIPTION
26Several applications need sine and cosine of the same angle
27.IR x .
674546ef 28These functions compute both at the same time, and store the results in
48dabc90
MK
29.I *sin
30and
31.IR *cos .
32
33If
34.I x
35is a NaN,
36a NaN is returned in
37.I *sin
38and
39.IR *cos .
40
41If
42.I x
43is positive infinity or negative infinity,
efe294cb 44a domain error occurs, and
48dabc90
MK
45a NaN is returned in
46.I *sin
47and
48.IR *cos .
49.SH RETURN VALUE
50These functions return
51.IR void .
52.SH ERRORS
53See
54.BR math_error (7)
55for information on how to determine whether an error has occurred
56when calling these functions.
57.PP
58The following errors can occur:
59.TP
60Domain error: \fIx\fP is an infinity
61.\" .I errno
62.\" is set to
63.\" .BR EDOM .
64An invalid floating-point exception
65.RB ( FE_INVALID )
66is raised.
67.PP
68These functions do not set
69.IR errno .
70.\" FIXME . Is it intentional that these functions do not set errno?
71.\" sin() and cos() also don't set errno; bugs have been raised for
72.\" those functions.
a699d2f2 73.\" See https://www.sourceware.org/bugzilla/show_bug.cgi?id=15467
f0d7ce1d
MK
74.SH VERSIONS
75These functions first appeared in glibc in version 2.1.
4d468698 76.SH ATTRIBUTES
d7ffc1d2
PH
77For an explanation of the terms used in this section, see
78.BR attributes (7).
79.TS
80allbox;
81lbw30 lb lb
82l l l.
83Interface Attribute Value
84T{
4d468698
PH
85.BR sincos (),
86.BR sincosf (),
4d468698 87.BR sincosl ()
d7ffc1d2
PH
88T} Thread safety MT-Safe
89.TE
47297adb 90.SH CONFORMING TO
674546ef 91These functions are GNU extensions.
47297adb 92.SH SEE ALSO
fea681da
MK
93.BR cos (3),
94.BR sin (3),
0a4f8b7b 95.BR tan (3)