]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>. |
8301c07d MK |
2 | .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk |
3 | .\" <mtk.manpages@gmail.com> | |
fea681da | 4 | .\" |
93015253 | 5 | .\" %%%LICENSE_START(VERBATIM) |
fea681da 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. | |
c13182ef | 14 | .\" |
fea681da MK |
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. | |
c13182ef | 22 | .\" |
fea681da MK |
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 |
fea681da | 26 | .\" |
4b8c67d9 | 27 | .TH SCALB 3 2017-09-15 "" "Linux Programmer's Manual" |
fea681da | 28 | .SH NAME |
8301c07d MK |
29 | scalb, scalbf, scalbl \- multiply floating-point number |
30 | by integral power of radix (OBSOLETE) | |
fea681da MK |
31 | .SH SYNOPSIS |
32 | .B #include <math.h> | |
68e4db0a | 33 | .PP |
fea681da MK |
34 | .BI "double scalb(double " x ", double " exp ); |
35 | .br | |
675a8e30 | 36 | .BI "float scalbf(float " x ", float " exp ); |
fea681da | 37 | .br |
675a8e30 | 38 | .BI "long double scalbl(long double " x ", long double " exp ); |
68e4db0a | 39 | .PP |
20c58d70 | 40 | Link with \fI\-lm\fP. |
68e4db0a | 41 | .PP |
cc4615cc MK |
42 | .in -4n |
43 | Feature Test Macro Requirements for glibc (see | |
44 | .BR feature_test_macros (7)): | |
45 | .in | |
68e4db0a | 46 | .PP |
cc4615cc | 47 | .ad l |
8301c07d | 48 | .BR scalb (): |
5f8bfc05 | 49 | .RS 4 |
636ed4d5 | 50 | _XOPEN_SOURCE\ >=\ 500 |
cf7fa0a1 | 51 | .\" || _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED |
636ed4d5 MK |
52 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE |
53 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
5f8bfc05 | 54 | .RE |
cc4615cc | 55 | .br |
8301c07d MK |
56 | .BR scalbf (), |
57 | .BR scalbl (): | |
5f8bfc05 | 58 | .RS 4 |
636ed4d5 MK |
59 | _XOPEN_SOURCE\ >=\ 600 |
60 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE | |
61 | || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
5f8bfc05 | 62 | .RE |
cc4615cc | 63 | .ad b |
fea681da MK |
64 | .SH DESCRIPTION |
65 | These functions multiply their first argument | |
66 | .I x | |
2f0af33b MK |
67 | by |
68 | .B FLT_RADIX | |
8301c07d MK |
69 | (probably 2) |
70 | to the power of | |
71 | .IR exp , | |
72 | that is: | |
207050fa | 73 | .PP |
8301c07d | 74 | .nf |
8301c07d MK |
75 | x * FLT_RADIX ** exp |
76 | .fi | |
847e0d88 | 77 | .PP |
8301c07d | 78 | The definition of |
2f0af33b | 79 | .B FLT_RADIX |
8301c07d | 80 | can be obtained by including |
a5e0a0e4 | 81 | .IR <float.h> . |
fea681da | 82 | .\" not in /usr/include but in a gcc lib |
8301c07d | 83 | .SH RETURN VALUE |
022671eb | 84 | On success, these functions return |
51700fd7 | 85 | .IR x |
022671eb MK |
86 | * |
87 | .B FLT_RADIX | |
88 | ** | |
89 | .IR exp . | |
847e0d88 | 90 | .PP |
8301c07d MK |
91 | If |
92 | .I x | |
93 | or | |
94 | .I exp | |
95 | is a NaN, a NaN is returned. | |
847e0d88 | 96 | .PP |
8301c07d MK |
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. | |
847e0d88 | 104 | .PP |
8301c07d MK |
105 | If |
106 | .I x | |
107 | is +0 (\-0), and | |
108 | .I exp | |
109 | is not positive infinity, +0 (\-0) is returned. | |
847e0d88 | 110 | .PP |
8301c07d MK |
111 | If |
112 | .I x | |
113 | is zero, and | |
114 | .I exp | |
115 | is positive infinity, | |
efe294cb | 116 | a domain error occurs, and |
8301c07d | 117 | a NaN is returned. |
847e0d88 | 118 | .PP |
8301c07d MK |
119 | If |
120 | .I x | |
121 | is an infinity, | |
122 | and | |
123 | .I exp | |
385cf745 | 124 | is negative infinity, |
efe294cb | 125 | a domain error occurs, and |
8301c07d | 126 | a NaN is returned. |
847e0d88 | 127 | .PP |
8301c07d | 128 | If the result overflows, |
efe294cb | 129 | a range error occurs, |
8301c07d MK |
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 . | |
847e0d88 | 137 | .PP |
8301c07d | 138 | If the result underflows, |
efe294cb | 139 | a range error occurs, |
8301c07d MK |
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, \ | |