1SCALB(3) Linux Programmer's Manual SCALB(3)
2
3
4
6 scalb, scalbf, scalbl - multiply floating-point number by integral
7 power of radix (OBSOLETE)
8
10 #include <math.h>
11
12 double scalb(double x, double exp);
13 float scalbf(float x, float exp);
14 long double scalbl(long double x, long double exp);
15
16 Link with -lm.
17
18 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
19
20 scalb():
21 _XOPEN_SOURCE >= 500
22 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
23 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24 scalbf(), scalbl():
25 _XOPEN_SOURCE >= 600
26 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
27 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
28
30 These functions multiply their first argument x by FLT_RADIX (probably
31 2) to the power of exp, that is:
32
33 x * FLT_RADIX ** exp
34
35 The definition of FLT_RADIX can be obtained by including <float.h>.
36
38 On success, these functions return x * FLT_RADIX ** exp.
39
40 If x or exp is a NaN, a NaN is returned.
41
42 If x is positive infinity (negative infinity), and exp is not negative
43 infinity, positive infinity (negative infinity) is returned.
44
45 If x is +0 (-0), and exp is not positive infinity, +0 (-0) is returned.
46
47 If x is zero, and exp is positive infinity, a domain error occurs, and
48 a NaN is returned.
49
50 If x is an infinity, and exp is negative infinity, a domain error oc‐
51 curs, and a NaN is returned.
52
53 If the result overflows, a range error occurs, and the functions return
54 HUGE_VAL, HUGE_VALF, or HUGE_VALL, respectively, with a sign the same
55 as x.
56
57 If the result underflows, a range error occurs, and the functions re‐
58 turn zero, with a sign the same as x.
59
61 See math_error(7) for information on how to determine whether an error
62 has occurred when calling these functions.
63
64 The following errors can occur:
65
66 Domain error: x is 0, and exp is positive infinity, or x is positive
67 infinity and exp is negative infinity and the other argument is not a
68 NaN
69 errno is set to EDOM. An invalid floating-point exception
70 (FE_INVALID) is raised.
71
72 Range error, overflow
73 errno is set to ERANGE. An overflow floating-point exception
74 (FE_OVERFLOW) is raised.
75
76 Range error, underflow
77 errno is set to ERANGE. An underflow floating-point exception
78 (FE_UNDERFLOW) is raised.
79
81 For an explanation of the terms used in this section, see at‐
82 tributes(7).
83
84 ┌─────────────────────────────┬───────────────┬─────────┐
85 │Interface │ Attribute │ Value │
86 ├─────────────────────────────┼───────────────┼─────────┤
87 │scalb(), scalbf(), scalbl() │ Thread safety │ MT-Safe │
88 └─────────────────────────────┴───────────────┴─────────┘
90 scalb() is specified in POSIX.1-2001, but marked obsolescent.
91 POSIX.1-2008 removes the specification of scalb(), recommending the use
92 of scalbln(3), scalblnf(3), or scalblnl(3) instead. The scalb() func‐
93 tion is from 4.3BSD.
94
95 scalbf() and scalbl() are unstandardized; scalbf() is nevertheless
96 present on several other systems
97
99 Before glibc 2.20, these functions did not set errno for domain and
100 range errors.
101
103 ldexp(3), scalbln(3)
104
106 This page is part of release 5.10 of the Linux man-pages project. A
107 description of the project, information about reporting bugs, and the
108 latest version of this page, can be found at
109 https://www.kernel.org/doc/man-pages/.
110
111
112
113 2020-06-09 SCALB(3)