]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/sincos.3
getresuid.2, mremap.2, poll.2, remap_file_pages.2, setresuid.2, splice.2, sync_file_r...
[thirdparty/man-pages.git] / man3 / sincos.3
CommitLineData
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
8sincos, 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 21Link with \fI\-lm\fP.
fea681da
MK
22.SH DESCRIPTION
23Several applications need sine and cosine of the same angle
24.IR x .
48dabc90
MK
25This function computes both at the same time, and stores the results in
26.I *sin
27and
28.IR *cos .
29
30If
31.I x
32is a NaN,
33a NaN is returned in
34.I *sin
35and
36.IR *cos .
37
38If
39.I x
40is positive infinity or negative infinity,
efe294cb 41a domain error occurs, and
48dabc90
MK
42a NaN is returned in
43.I *sin
44and
45.IR *cos .
46.SH RETURN VALUE
47These functions return
48.IR void .
49.SH ERRORS
50See
51.BR math_error (7)
52for information on how to determine whether an error has occurred
53when calling these functions.
54.PP
55The following errors can occur:
56.TP
57Domain error: \fIx\fP is an infinity
58.\" .I errno
59.\" is set to
60.\" .BR EDOM .
61An invalid floating-point exception
62.RB ( FE_INVALID )
63is raised.
64.PP
65These 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
71These functions first appeared in glibc in version 2.1.
fea681da
MK
72.SH "CONFORMING TO"
73This 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)