wait.2: Add ESRCH for when pid == INT_MIN
[man-pages.git] / man3 / erfc.3
blob72facdaf9bc73b496b6dbaa54e003c9d54603939
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  2021-03-22 "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 .PP
33 .BI "double erfc(double " x );
34 .BI "float erfcf(float " x );
35 .BI "long double erfcl(long double " x );
36 .fi
37 .PP
38 Link with \fI\-lm\fP.
39 .PP
40 .RS -4
41 Feature Test Macro Requirements for glibc (see
42 .BR feature_test_macros (7)):
43 .RE
44 .PP
45 .BR erfc ():
46 .nf
47     _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE
48         || /* Since glibc 2.19: */ _DEFAULT_SOURCE
49         || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
50 .fi
51 .PP
52 .BR erfcf (),
53 .BR erfcl ():
54 .nf
55     _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
56         || /* Since glibc 2.19: */ _DEFAULT_SOURCE
57         || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
58 .fi
59 .SH DESCRIPTION
60 These functions return the complementary error function of
61 .IR x ,
62 that is, 1.0 \- erf(x).
63 .SH RETURN VALUE
64 On success, these functions return the complementary error function of
65 .IR x ,
66 a value in the range [0,2].
67 .PP
69 .I x
70 is a NaN, a NaN is returned.
71 .PP
73 .I x
74 is +0 or \-0, 1 is returned.
75 .PP
77 .I x
78 is positive infinity,
79 +0 is returned.
80 .PP
82 .I x
83 is negative infinity,
84 +2 is returned.
85 .PP
86 If the function result underflows and produces an unrepresentable value,
87 the return value is 0.0.
88 .PP
89 If the function result underflows but produces a representable
90 (i.e., subnormal) value,
91 .\" e.g., erfc(27) on x86-32
92 that value is returned, and
93 a range error occurs.
94 .SH ERRORS
95 See
96 .BR math_error (7)
97 for information on how to determine whether an error has occurred
98 when calling these functions.
99 .PP
100 The following errors can occur:
102 Range error: result underflow (result is subnormal)
103 .\" .I errno
104 .\" is set to
105 .\" .BR ERANGE .
106 An underflow floating-point exception
107 .RB ( FE_UNDERFLOW )
108 is raised.
110 These functions do not set
111 .IR errno .
112 .\" It is intentional that these functions do not set errno for this case
113 .\" see http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785
114 .SH ATTRIBUTES
115 For an explanation of the terms used in this section, see
116 .BR attributes (7).
117 .ad l
120 allbox;
121 lbx lb lb
122 l l l.
123 Interface       Attribute       Value
125 .BR erfc (),
126 .BR erfcf (),
127 .BR erfcl ()
128 T}      Thread safety   MT-Safe
132 .sp 1
133 .SH CONFORMING TO
134 C99, POSIX.1-2001, POSIX.1-2008.
136 The variant returning
137 .I double
138 also conforms to
139 SVr4, 4.3BSD.
140 .SH NOTES
142 .BR erfc (),
143 .BR erfcf (),
145 .BR erfcl ()
146 functions are provided to avoid the loss accuracy that
147 would occur for the calculation 1-erf(x) for large values of
148 .IR x
149 (for which the value of erf(x) approaches 1).
150 .SH SEE ALSO
151 .BR cerf (3),
152 .BR erf (3),
153 .BR exp (3)