OSDN Git Service

(split) LDP man-pages の original/ を v3.30 に更新。
[linuxjm/LDP_man-pages.git] / original / man3 / sincos.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL, 2002-07-27 Walter Harms
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\"     <mtk.manpages@gmail.com>
5 .\"
6 .TH SINCOS 3  2008-08-11 "GNU" "Linux Programmer's Manual"
7 .SH NAME
8 sincos, sincosf, sincosl \- calculate sin and cos simultaneously
9 .SH SYNOPSIS
10 .nf
11 .BR "#define _GNU_SOURCE" "         /* See feature_test_macros(7) */"
12 .B #include <math.h>
13 .sp
14 .BI "void sincos(double " x ", double *" sin ", double *" cos );
15 .br
16 .BI "void sincosf(float " x ", float *" sin ", float *" cos );
17 .br
18 .BI "void sincosl(long double " x ", long double *" sin ", long double *" cos );
19 .fi
20 .sp
21 Link with \fI\-lm\fP.
22 .SH DESCRIPTION
23 Several applications need sine and cosine of the same angle
24 .IR x .
25 This function computes both at the same time, and stores the results in
26 .I *sin
27 and
28 .IR *cos .
29
30 If
31 .I x
32 is a NaN,
33 a NaN is returned in
34 .I *sin
35 and
36 .IR *cos .
37
38 If
39 .I x
40 is positive infinity or negative infinity,
41 a domain error occurs, and
42 a NaN is returned in
43 .I *sin
44 and
45 .IR *cos .
46 .SH RETURN VALUE
47 These functions return
48 .IR void .
49 .SH ERRORS
50 See
51 .BR math_error (7)
52 for information on how to determine whether an error has occurred
53 when calling these functions.
54 .PP
55 The following errors can occur:
56 .TP
57 Domain error: \fIx\fP is an infinity
58 .\" .I errno
59 .\" is set to
60 .\" .BR EDOM .
61 An invalid floating-point exception
62 .RB ( FE_INVALID )
63 is raised.
64 .PP
65 These 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.
70 .SH VERSIONS
71 These functions first appeared in glibc in version 2.1.
72 .SH "CONFORMING TO"
73 This function is a GNU extension.
74 .SH "SEE ALSO"
75 .BR cos (3),
76 .BR sin (3),
77 .BR tan (3)