OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / 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  2013-12-23 "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 .sp
17 .BI "void sincos(double " x ", double *" sin ", double *" cos );
18 .br
19 .BI "void sincosf(float " x ", float *" sin ", float *" cos );
20 .br
21 .BI "void sincosl(long double " x ", long double *" sin ", long double *" cos );
22 .fi
23 .sp
24 Link with \fI\-lm\fP.
25 .SH DESCRIPTION
26 Several applications need sine and cosine of the same angle
27 .IR x .
28 This function computes both at the same time, and stores the results in
29 .I *sin
30 and
31 .IR *cos .
32
33 If
34 .I x
35 is a NaN,
36 a NaN is returned in
37 .I *sin
38 and
39 .IR *cos .
40
41 If
42 .I x
43 is positive infinity or negative infinity,
44 a domain error occurs, and
45 a NaN is returned in
46 .I *sin
47 and
48 .IR *cos .
49 .SH RETURN VALUE
50 These functions return
51 .IR void .
52 .SH ERRORS
53 See
54 .BR math_error (7)
55 for information on how to determine whether an error has occurred
56 when calling these functions.
57 .PP
58 The following errors can occur:
59 .TP
60 Domain error: \fIx\fP is an infinity
61 .\" .I errno
62 .\" is set to
63 .\" .BR EDOM .
64 An invalid floating-point exception
65 .RB ( FE_INVALID )
66 is raised.
67 .PP
68 These 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.
73 .\" See https://www.sourceware.org/bugzilla/show_bug.cgi?id=15467
74 .SH VERSIONS
75 These functions first appeared in glibc in version 2.1.
76 .SH ATTRIBUTES
77 .SS Multithreading (see pthreads(7))
78 The
79 .BR sincos (),
80 .BR sincosf (),
81 and
82 .BR sincosl ()
83 functions are thread-safe.
84 .SH CONFORMING TO
85 This function is a GNU extension.
86 .SH SEE ALSO
87 .BR cos (3),
88 .BR sin (3),
89 .BR tan (3)
90 .SH COLOPHON
91 This page is part of release 3.79 of the Linux
92 .I man-pages
93 project.
94 A description of the project,
95 information about reporting bugs,
96 and the latest version of this page,
97 can be found at
98 \%http://www.kernel.org/doc/man\-pages/.