]>
Commit | Line | Data |
---|---|---|
d65519e8 MK |
1 | .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>. |
2 | .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk | |
3 | .\" <mtk.manpages@gmail.com> | |
4 | .\" | |
93015253 | 5 | .\" %%%LICENSE_START(VERBATIM) |
d65519e8 MK |
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. | |
4b72fb64 | 25 | .\" %%%LICENSE_END |
d65519e8 | 26 | .\" |
4b8c67d9 | 27 | .TH SCALBLN 3 2017-09-15 "" "Linux Programmer's Manual" |
d65519e8 MK |
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> | |
68e4db0a | 33 | .PP |
d65519e8 MK |
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 ); | |
68e4db0a | 39 | .PP |
d65519e8 MK |
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 ); | |
68e4db0a | 45 | .PP |
d65519e8 | 46 | Link with \fI\-lm\fP. |
68e4db0a | 47 | .PP |
d65519e8 MK |
48 | .in -4n |
49 | Feature Test Macro Requirements for glibc (see | |
50 | .BR feature_test_macros (7)): | |
51 | .in | |
68e4db0a | 52 | .PP |
d65519e8 MK |
53 | .ad l |
54 | .BR scalbln (), | |
55 | .BR scalblnf (), | |
56 | .BR scalblnl (): | |
4b8e6548 | 57 | .RS |
e464f054 | 58 | _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L |
636ed4d5 | 59 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE |
4b8e6548 | 60 | .RE |
d65519e8 MK |
61 | .br |
62 | .BR scalbn (), | |
63 | .BR scalbnf (), | |
64 | .BR scalbnl (): | |
4b8e6548 | 65 | .RS |
636ed4d5 MK |
66 | _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L |
67 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE | |
68 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
4b8e6548 | 69 | .RE |
d65519e8 MK |
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: | |
207050fa | 80 | .PP |
d65519e8 | 81 | .nf |
d65519e8 MK |
82 | x * FLT_RADIX ** exp |
83 | .fi | |
847e0d88 | 84 | .PP |
d65519e8 MK |
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 | |
022671eb | 91 | On success, these functions return |
51700fd7 | 92 | .IR x |
022671eb MK |
93 | * |
94 | .B FLT_RADIX | |
95 | ** | |
96 | .IR exp . | |
847e0d88 | 97 | .PP |
d65519e8 MK |
98 | If |
99 | .I x | |
100 | is a NaN, a NaN is returned. | |
847e0d88 | 101 | .PP |
d65519e8 MK |
102 | If |
103 | .I x | |
104 | is positive infinity (negative infinity), | |
105 | positive infinity (negative infinity) is returned. | |
847e0d88 | 106 | .PP |
d65519e8 MK |
107 | If |
108 | .I x | |
109 | is +0 (\-0), +0 (\-0) is returned. | |
847e0d88 | 110 | .PP |
d65519e8 | 111 | If the result overflows, |
efe294cb | 112 | a range error occurs, |
d65519e8 MK |
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 . | |
847e0d88 | 120 | .PP |
d65519e8 | 121 | If the result underflows, |
efe294cb | 122 | a range error occurs, |
d65519e8 MK |
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 | |
f0d7ce1d MK |
153 | .SH VERSIONS |
154 | These functions first appeared in glibc in version 2.1. | |
6d74e861 | 155 | .SH ATTRIBUTES |
5880380f PH |
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{ | |
6d74e861 PH |
164 | .BR scalbn (), |
165 | .BR scalbnf (), | |
166 | .BR scalbnl (), | |
5880380f | 167 | .br |
6d74e861 PH |
168 | .BR scalbln (), |
169 | .BR scalblnf (), | |
6d74e861 | 170 | .BR scalblnl () |
5880380f PH |
171 | T} Thread safety MT-Safe |
172 | .TE | |
47297adb | 173 | .SH CONFORMING TO |
9a74e018 | 174 | C99, POSIX.1-2001, POSIX.1-2008. |
d65519e8 MK |
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 . | |
847e0d88 | 184 | .PP |
d65519e8 MK |
185 | If |
186 | .B FLT_RADIX | |
187 | equals 2 (which is usual), then | |
188 | .BR scalbn () | |
189 | is equivalent to | |
190 | .BR ldexp (3). | |
47297adb | 191 | .SH SEE ALSO |
d65519e8 MK |
192 | .BR ldexp (3), |
193 | .BR scalb (3) |