]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/scalbln.3
libc.7: Add a note on why glibc 2.x uses the soname libc.so.6
[thirdparty/man-pages.git] / man3 / scalbln.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 SCALBLN 3 2016-03-15 "" "Linux Programmer's Manual"
28 .SH NAME
29 scalbn, scalbnf, scalbnl, scalbln, scalblnf, scalblnl \-
30 multiply floating-point number by integral power of radix
31 .SH SYNOPSIS
32 .B #include <math.h>
33 .sp
34 .BI "double scalbln(double " x ", long int " exp );
35 .br
36 .BI "float scalblnf(float " x ", long int " exp );
37 .br
38 .BI "long double scalblnl(long double " x ", long int " exp );
39 .sp
40 .BI "double scalbn(double " x ", int " exp );
41 .br
42 .BI "float scalbnf(float " x ", int " exp );
43 .br
44 .BI "long double scalbnl(long double " x ", int " exp );
45 .sp
46 Link with \fI\-lm\fP.
47 .sp
48 .in -4n
49 Feature Test Macro Requirements for glibc (see
50 .BR feature_test_macros (7)):
51 .in
52 .sp
53 .ad l
54 .BR scalbln (),
55 .BR scalblnf (),
56 .BR scalblnl ():
57 .RS
58 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
59 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
60 .RE
61 .br
62 .BR scalbn (),
63 .BR scalbnf (),
64 .BR scalbnl ():
65 .RS
66 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
67 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
68 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
69 .RE
70 .ad b
71 .SH DESCRIPTION
72 These functions multiply their first argument
73 .I x
74 by
75 .B FLT_RADIX
76 (probably 2)
77 to the power of
78 .IR exp ,
79 that is:
80 .nf
81
82 x * FLT_RADIX ** exp
83 .fi
84
85 The definition of
86 .B FLT_RADIX
87 can be obtained by including
88 .IR <float.h> .
89 .\" not in /usr/include but in a gcc lib
90 .SH RETURN VALUE
91 On success, these functions return
92 .IR x
93 *
94 .B FLT_RADIX
95 **
96 .IR exp .
97
98 If
99 .I x
100 is a NaN, a NaN is returned.
101
102 If
103 .I x
104 is positive infinity (negative infinity),
105 positive infinity (negative infinity) is returned.
106
107 If
108 .I x
109 is +0 (\-0), +0 (\-0) is returned.
110
111 If the result overflows,
112 a range error occurs,
113 and the functions return
114 .BR HUGE_VAL ,
115 .BR HUGE_VALF ,
116 or
117 .BR HUGE_VALL ,
118 respectively, with a sign the same as
119 .IR x .
120
121 If the result underflows,
122 a range error occurs,
123 and the functions return zero, with a sign the same as
124 .IR x .
125 .SH ERRORS
126 See
127 .BR math_error (7)
128 for information on how to determine whether an error has occurred
129 when calling these functions.
130 .PP
131 The following errors can occur:
132 .TP
133 Range error, overflow
134 .\" .I errno
135 .\" is set to
136 .\" .BR ERANGE .
137 An overflow floating-point exception
138 .RB ( FE_OVERFLOW )
139 is raised.
140 .TP
141 Range error, underflow
142 .\" .I errno
143 .\" is set to
144 .\" .BR ERANGE .
145 An underflow floating-point exception
146 .RB ( FE_UNDERFLOW )
147 is raised.
148 .PP
149 These functions do not set
150 .IR errno .
151 .\" FIXME . Is it intentional that these functions do not set errno?
152 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803
153 .SH VERSIONS
154 These functions first appeared in glibc in version 2.1.
155 .SH ATTRIBUTES
156 For an explanation of the terms used in this section, see
157 .BR attributes (7).
158 .TS
159 allbox;
160 lbw33 lb lb
161 l l l.
162 Interface Attribute Value
163 T{
164 .BR scalbn (),
165 .BR scalbnf (),
166 .BR scalbnl (),
167 .br
168 .BR scalbln (),
169 .BR scalblnf (),
170 .BR scalblnl ()
171 T} Thread safety MT-Safe
172 .TE
173 .SH CONFORMING TO
174 C99, POSIX.1-2001, POSIX.1-2008.
175 .SH NOTES
176 These functions differ from the obsolete functions described in
177 .BR scalb (3)
178 in the type of their second argument.
179 The functions described on this page have a second argument
180 of an integral type, while those in
181 .BR scalb (3)
182 have a second argument of type
183 .IR double .
184
185 If
186 .B FLT_RADIX
187 equals 2 (which is usual), then
188 .BR scalbn ()
189 is equivalent to
190 .BR ldexp (3).
191 .SH SEE ALSO
192 .BR ldexp (3),
193 .BR scalb (3)