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
51 occurs, 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
58 return 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 An invalid floating-point exception (FE_INVALID) is raised.
70
71 Range error, overflow
72 An overflow floating-point exception (FE_OVERFLOW) is raised.
73
74 Range error, underflow
75 An underflow floating-point exception (FE_UNDERFLOW) is raised.
76
77 These functions do not set errno.
78
80 For an explanation of the terms used in this section, see
81 attributes(7).
82
83 ┌─────────────────────────────┬───────────────┬─────────┐
84 │Interface │ Attribute │ Value │
85 ├─────────────────────────────┼───────────────┼─────────┤
86 │scalb(), scalbf(), scalbl() │ Thread safety │ MT-Safe │
87 └─────────────────────────────┴───────────────┴─────────┘
89 scalb() is specified in POSIX.1-2001, but marked obsolescent.
90 POSIX.1-2008 removes the specification of scalb(), recommending the use
91 of scalbln(3), scalblnf(3), or scalblnl(3) instead. The scalb() func‐
92 tion is from 4.3BSD.
93
94 scalbf() and scalbl() are unstandardized; scalbf() is nevertheless
95 present on several other systems
96
98 ldexp(3), scalbln(3)
99
101 This page is part of release 4.15 of the Linux man-pages project. A
102 description of the project, information about reporting bugs, and the
103 latest version of this page, can be found at
104 https://www.kernel.org/doc/man-pages/.
105
106
107
108 2017-09-15 SCALB(3)