]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sincos.3
proc.5: ffix
[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 15.B #include <math.h>
68e4db0a 16.PP
fea681da 17.BI "void sincos(double " x ", double *" sin ", double *" cos );
fea681da 18.BI "void sincosf(float " x ", float *" sin ", float *" cos );
fea681da
MK
19.BI "void sincosl(long double " x ", long double *" sin ", long double *" cos );
20.fi
68e4db0a 21.PP
20c58d70 22Link with \fI\-lm\fP.
fea681da
MK
23.SH DESCRIPTION
24Several applications need sine and cosine of the same angle
25.IR x .
674546ef 26These functions compute both at the same time, and store the results in
48dabc90
MK
27.I *sin
28and
29.IR *cos .
847e0d88 30.PP
48dabc90
MK
31If
32.I x
33is a NaN,
34a NaN is returned in
35.I *sin
36and
37.IR *cos .
847e0d88 38.PP
48dabc90
MK
39If
40.I x
41is positive infinity or negative infinity,
efe294cb 42a domain error occurs, and
48dabc90
MK
43a NaN is returned in
44.I *sin
45and
46.IR *cos .
47.SH RETURN VALUE
48These functions return
49.IR void .
50.SH ERRORS
51See
52.BR math_error (7)
53for information on how to determine whether an error has occurred
54when calling these functions.
55.PP
56The following errors can occur:
57.TP
58Domain error: \fIx\fP is an infinity
59.\" .I errno
60.\" is set to
61.\" .BR EDOM .
62An invalid floating-point exception
63.RB ( FE_INVALID )
64is raised.
65.PP
66These functions do not set
67.IR errno .
68.\" FIXME . Is it intentional that these functions do not set errno?
69.\" sin() and cos() also don't set errno; bugs have been raised for
70.\" those functions.
a699d2f2 71.\" See https://www.sourceware.org/bugzilla/show_bug.cgi?id=15467
f0d7ce1d
MK
72.SH VERSIONS
73These functions first appeared in glibc in version 2.1.
4d468698 74.SH ATTRIBUTES
d7ffc1d2
PH
75For an explanation of the terms used in this section, see
76.BR attributes (7).
77.TS
78allbox;
79lbw30 lb lb
80l l l.
81Interface Attribute Value
82T{
4d468698
PH
83.BR sincos (),
84.BR sincosf (),
4d468698 85.BR sincosl ()
d7ffc1d2
PH
86T} Thread safety MT-Safe
87.TE
47297adb 88.SH CONFORMING TO
674546ef 89These functions are GNU extensions.
47297adb 90.SH SEE ALSO
fea681da
MK
91.BR cos (3),
92.BR sin (3),
0a4f8b7b 93.BR tan (3)