]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/scalb.3
capabilities.7: Add pivot_root(2) to CAP_SYS_ADMIN list
[thirdparty/man-pages.git] / man3 / scalb.3
1 .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date. The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein. The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .TH SCALB 3 2017-09-15 "" "Linux Programmer's Manual"
28 .SH NAME
29 scalb, scalbf, scalbl \- multiply floating-point number
30 by integral power of radix (OBSOLETE)
31 .SH SYNOPSIS
32 .B #include <math.h>
33 .PP
34 .BI "double scalb(double " x ", double " exp );
35 .br
36 .BI "float scalbf(float " x ", float " exp );
37 .br
38 .BI "long double scalbl(long double " x ", long double " exp );
39 .PP
40 Link with \fI\-lm\fP.
41 .PP
42 .in -4n
43 Feature Test Macro Requirements for glibc (see
44 .BR feature_test_macros (7)):
45 .in
46 .PP
47 .ad l
48 .BR scalb ():
49 .RS 4
50 _XOPEN_SOURCE\ >=\ 500
51 .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
52 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
53 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
54 .RE
55 .br
56 .BR scalbf (),
57 .BR scalbl ():
58 .RS 4
59 _XOPEN_SOURCE\ >=\ 600
60 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
61 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
62 .RE
63 .ad b
64 .SH DESCRIPTION
65 These functions multiply their first argument
66 .I x
67 by
68 .B FLT_RADIX
69 (probably 2)
70 to the power of
71 .IR exp ,
72 that is:
73 .PP
74 .nf
75 x * FLT_RADIX ** exp
76 .fi
77 .PP
78 The definition of
79 .B FLT_RADIX
80 can be obtained by including
81 .IR <float.h> .
82 .\" not in /usr/include but in a gcc lib
83 .SH RETURN VALUE
84 On success, these functions return
85 .IR x
86 *
87 .B FLT_RADIX
88 **
89 .IR exp .
90 .PP
91 If
92 .I x
93 or
94 .I exp
95 is a NaN, a NaN is returned.
96 .PP
97 If
98 .I x
99 is positive infinity (negative infinity),
100 and
101 .I exp
102 is not negative infinity,
103 positive infinity (negative infinity) is returned.
104 .PP
105 If
106 .I x
107 is +0 (\-0), and
108 .I exp
109 is not positive infinity, +0 (\-0) is returned.
110 .PP
111 If
112 .I x
113 is zero, and
114 .I exp
115 is positive infinity,
116 a domain error occurs, and
117 a NaN is returned.
118 .PP
119 If
120 .I x
121 is an infinity,
122 and
123 .I exp
124 is negative infinity,
125 a domain error occurs, and
126 a NaN is returned.
127 .PP
128 If the result overflows,
129 a range error occurs,
130 and the functions return
131 .BR HUGE_VAL ,
132 .BR HUGE_VALF ,
133 or
134 .BR HUGE_VALL ,
135 respectively, with a sign the same as
136 .IR x .
137 .PP
138 If the result underflows,
139 a range error occurs,
140 and the functions return zero, with a sign the same as
141 .IR x .
142 .SH ERRORS
143 See
144 .BR math_error (7)
145 for information on how to determine whether an error has occurred
146 when calling these functions.
147 .PP
148 The following errors can occur:
149 .TP
150 Domain error: \fIx\fP is 0, and \fIexp\fP is positive infinity, \
151 or \fIx\fP is positive infinity and \fIexp\fP is negative infinity \
152 and the other argument is not a NaN
153 .\" .I errno
154 .\" is set to
155 .\" .BR EDOM .
156 An invalid floating-point exception
157 .RB ( FE_INVALID )
158 is raised.
159 .TP
160 Range error, overflow
161 .\" .I errno
162 .\" is set to
163 .\" .BR ERANGE .
164 An overflow floating-point exception
165 .RB ( FE_OVERFLOW )
166 is raised.
167 .TP
168 Range error, underflow
169 .\" .I errno
170 .\" is set to
171 .\" .BR ERANGE .
172 An underflow floating-point exception
173 .RB ( FE_UNDERFLOW )
174 is raised.
175 .PP
176 These functions do not set
177 .IR errno .
178 .\" FIXME . Is it intentional that these functions do not set errno?
179 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803
180 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6804
181 .SH ATTRIBUTES
182 For an explanation of the terms used in this section, see
183 .BR attributes (7).
184 .TS
185 allbox;
186 lbw28 lb lb
187 l l l.
188 Interface Attribute Value
189 T{
190 .BR scalb (),
191 .BR scalbf (),
192 .BR scalbl ()
193 T} Thread safety MT-Safe
194 .TE
195 .SH CONFORMING TO
196 .BR scalb ()
197 is specified in POSIX.1-2001, but marked obsolescent.
198 POSIX.1-2008 removes the specification of
199 .BR scalb (),
200 recommending the use of
201 .BR scalbln (3),
202 .BR scalblnf (3),
203 or
204 .BR scalblnl (3)
205 instead.
206 The
207 .BR scalb ()
208 function is from 4.3BSD.
209 .PP
210 .BR scalbf ()
211 and
212 .BR scalbl ()
213 are unstandardized;
214 .BR scalbf ()
215 is nevertheless present on several other systems
216 .\" Looking at header files: scalbf() is present on the
217 .\" BSDs, Tru64, HP-UX 11, Irix 6.5; scalbl() is on HP-UX 11 and Tru64.
218 .SH SEE ALSO
219 .BR ldexp (3),
220 .BR scalbln (3)