OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / erfc.3
1 .\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
2 .\"     <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .TH ERFC 3  2013-10-29 "GNU" "Linux Programmer's Manual"
27 .SH NAME
28 erfc, erfcf, erfcl \- complementary error function
29 .SH SYNOPSIS
30 .nf
31 .B #include <math.h>
32
33 .BI "double erfc(double " x );
34 .BI "float erfcf(float " x );
35 .BI "long double erfcl(long double " x );
36
37 .fi
38 Link with \fI\-lm\fP.
39 .sp
40 .in -4n
41 Feature Test Macro Requirements for glibc (see
42 .BR feature_test_macros (7)):
43 .in
44 .sp
45 .ad l
46 .BR erfc ():
47 .RS 4
48 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE || _ISOC99_SOURCE ||
49 _POSIX_C_SOURCE\ >=\ 200112L;
50 .br
51 or
52 .I cc\ -std=c99
53 .RE
54 .br
55 .BR erfcf (),
56 .BR erfcl ():
57 .RS 4
58 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600|| _ISOC99_SOURCE ||
59 _POSIX_C_SOURCE\ >=\ 200112L;
60 .br
61 or
62 .I cc\ -std=c99
63 .RE
64 .ad b
65 .SH DESCRIPTION
66 The
67 .BR erfc ()
68 function returns the complementary error function of
69 .IR x ,
70 that is, 1.0 \- erf(x).
71 .SH RETURN VALUE
72 On success, these functions return the complementary error function of
73 .IR x ,
74 a value in the range [0,2].
75
76 If
77 .I x
78 is a NaN, a NaN is returned.
79
80 If
81 .I x
82 is +0 or \-0, 1 is returned.
83
84 If
85 .I x
86 is positive infinity,
87 +0 is returned.
88
89 If
90 .I x
91 is negative infinity,
92 +2 is returned.
93
94 If the function result underflows and produces an unrepresentable value,
95 the return value is 0.0.
96
97 If the function result underflows but produces a representable
98 (i.e., subnormal) value,
99 .\" e.g., erfc(27) on x86-32
100 that value is returned, and
101 a range error occurs.
102 .SH ERRORS
103 See
104 .BR math_error (7)
105 for information on how to determine whether an error has occurred
106 when calling these functions.
107 .PP
108 The following errors can occur:
109 .TP
110 Range error: result underflow (result is subnormal)
111 .\" .I errno
112 .\" is set to
113 .\" .BR ERANGE .
114 An underflow floating-point exception
115 .RB ( FE_UNDERFLOW )
116 is raised.
117 .PP
118 These functions do not set
119 .IR errno .
120 .\" FIXME . Is it intentional that these functions do not set errno?
121 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785
122 .SH ATTRIBUTES
123 .SS Multithreading (see pthreads(7))
124 The
125 .BR erfc (),
126 .BR erfcf (),
127 and
128 .BR erfcl ()
129 functions are thread-safe.
130 .SH CONFORMING TO
131 C99, POSIX.1-2001.
132 The variant returning
133 .I double
134 also conforms to
135 SVr4, 4.3BSD.
136 .SH NOTES
137 The
138 .BR erfc (),
139 .BR erfcf (),
140 and
141 .BR erfcl ()
142 functions are provided to avoid the loss accuracy that
143 would occur for the calculation 1-erf(x) for large values of
144 .IR x
145 (for which the value of erf(x) approaches 1).
146 .SH SEE ALSO
147 .BR cerf (3),
148 .BR erf (3),
149 .BR exp (3)
150 .SH COLOPHON
151 This page is part of release 3.79 of the Linux
152 .I man-pages
153 project.
154 A description of the project,
155 information about reporting bugs,
156 and the latest version of this page,
157 can be found at
158 \%http://www.kernel.org/doc/man\-pages/.