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