OSDN Git Service

(split) LDP man-pages の original/ を v3.29 に更新。
[linuxjm/LDP_man-pages.git] / original / 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 .\" 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 .\"
25 .TH SCALB 3 2010-09-20 "" "Linux Programmer's Manual"
26 .SH NAME
27 scalb, scalbf, scalbl \- multiply floating-point number
28 by integral power of radix (OBSOLETE)
29 .SH SYNOPSIS
30 .B #include <math.h>
31 .sp
32 .BI "double scalb(double " x ", double " exp );
33 .br
34 .BI "float scalbf(float " x ", double " exp );
35 .br
36 .BI "long double scalbl(long double " x ", double " exp );
37 .sp
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 scalb ():
47 .RS 4
48 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500 ||
49 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
50 .RE
51 .br
52 .BR scalbf (),
53 .BR scalbl ():
54 .RS 4
55 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600
56 .RE
57 .ad b
58 .SH DESCRIPTION
59 These functions multiply their first argument
60 .I x
61 by
62 .B FLT_RADIX
63 (probably 2)
64 to the power of
65 .IR exp ,
66 that is:
67 .nf
68
69     x * FLT_RADIX ** exp
70 .fi
71
72 The definition of
73 .B FLT_RADIX
74 can be obtained by including
75 .IR <float.h> .
76 .\" not in /usr/include but in a gcc lib
77 .SH RETURN VALUE
78 On success, these functions return \fIx\fP * \fBFLT_RADIX\fP ** \fIexp\fP.
79
80 If
81 .I x
82 or
83 .I exp
84 is a NaN, a NaN is returned.
85
86 If
87 .I x
88 is positive infinity (negative infinity),
89 and
90 .I exp
91 is not negative infinity,
92 positive infinity (negative infinity) is returned.
93
94 If
95 .I x
96 is +0 (\-0), and
97 .I exp
98 is not positive infinity, +0 (\-0) is returned.
99
100 If
101 .I x
102 is zero, and
103 .I exp
104 is positive infinity,
105 a domain error occurs, and
106 a NaN is returned.
107
108 If
109 .I x
110 is an infinity,
111 and
112 .I exp
113 is negative infinity,
114 a domain error occurs, and
115 a NaN is returned.
116
117 If the result overflows,
118 a range error occurs,
119 and the functions return
120 .BR HUGE_VAL ,
121 .BR HUGE_VALF ,
122 or
123 .BR HUGE_VALL ,
124 respectively, with a sign the same as
125 .IR x .
126
127 If the result underflows,
128 a range error occurs,
129 and the functions return zero, with a sign the same as
130 .IR x .
131 .SH ERRORS
132 See
133 .BR math_error (7)
134 for information on how to determine whether an error has occurred
135 when calling these functions.
136 .PP
137 The following errors can occur:
138 .TP
139 Domain error: \fIx\fP is 0, and \fIexp\fP is positive infinity, \
140 or \fIx\fP is positive infinity and \fIexp\fP is negative infinity \
141 and the other argument is not a NaN
142 .\" .I errno
143 .\" is set to
144 .\" .BR EDOM .
145 An invalid floating-point exception
146 .RB ( FE_INVALID )
147 is raised.
148 .TP
149 Range error, overflow
150 .\" .I errno
151 .\" is set to
152 .\" .BR ERANGE .
153 An overflow floating-point exception
154 .RB ( FE_OVERFLOW )
155 is raised.
156 .TP
157 Range error, underflow
158 .\" .I errno
159 .\" is set to
160 .\" .BR ERANGE .
161 An underflow floating-point exception
162 .RB ( FE_UNDERFLOW )
163 is raised.
164 .PP
165 These functions do not set
166 .IR errno .
167 .\" FIXME . Is it intentional that these functions do not set errno?
168 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803
169 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6804
170 .SH "CONFORMING TO"
171 .BR scalb ()
172 is specified in POSIX.1-2001, but marked obsolescent.
173 POSIX.1-2008 removes the specification of
174 .BR scalb (),
175 recommending the use of
176 .BR scalbln (3),
177 .BR scalblnf (3),
178 or
179 .BR scalblnl (3)
180 instead.
181 The
182 .BR scalb ()
183 function is from 4.3BSD.
184
185 .BR scalbf ()
186 and
187 .BR scalbl ()
188 are unstandardized;
189 .BR scalbf ()
190 is nevertheless present on several other systems
191 .\" Looking at header files: scalbf() is present on the
192 .\" BSDs, Tru64, HP-UX 11, Irix 6.5; scalbl() is on HP-UX 11 and Tru64.
193 .SH "SEE ALSO"
194 .BR ldexp (3),
195 .BR scalbln (3)