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 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500 ||
22 _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED
23 scalbf(), scalbl():
24 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 600
25
27 These functions multiply their first argument x by FLT_RADIX (probably
28 2) to the power of exp, that is:
29
30 x * FLT_RADIX ** exp
31
32 The definition of FLT_RADIX can be obtained by including <float.h>.
33
35 On success, these functions return x * FLT_RADIX ** exp.
36
37 If x or exp is a NaN, a NaN is returned.
38
39 If x is positive infinity (negative infinity), and exp is not negative
40 infinity, positive infinity (negative infinity) is returned.
41
42 If x is +0 (-0), and exp is not positive infinity, +0 (-0) is returned.
43
44 If x is zero, and exp is positive infinity, a domain error occurs, and
45 a NaN is returned.
46
47 If x is an infinity, and exp is negative infinity, a domain error
48 occurs, and a NaN is returned.
49
50 If the result overflows, a range error occurs, and the functions return
51 HUGE_VAL, HUGE_VALF, or HUGE_VALL, respectively, with a sign the same
52 as x.
53
54 If the result underflows, a range error occurs, and the functions
55 return zero, with a sign the same as x.
56
58 See math_error(7) for information on how to determine whether an error
59 has occurred when calling these functions.
60
61 The following errors can occur:
62
63 Domain error: x is 0, and exp is positive infinity, or x is positive
64 infinity and exp is negative infinity and the other argument is not a
65 NaN
66 An invalid floating-point exception (FE_INVALID) is raised.
67
68 Range error, overflow
69 An overflow floating-point exception (FE_OVERFLOW) is raised.
70
71 Range error, underflow
72 An underflow floating-point exception (FE_UNDERFLOW) is raised.
73
74 These functions do not set errno.
75
77 scalb() is specified in POSIX.1-2001, but marked obsolescent.
78 POSIX.1-2008 removes the specification of scalb(), recommending the use
79 of scalbln(3), scalblnf(3), or scalblnl(3) instead. The scalb() func‐
80 tion is from 4.3BSD.
81
82 scalbf() and scalbl() are unstandardized; scalbf() is nevertheless
83 present on several other systems
84
86 ldexp(3), scalbln(3)
87
89 This page is part of release 3.53 of the Linux man-pages project. A
90 description of the project, and information about reporting bugs, can
91 be found at http://www.kernel.org/doc/man-pages/.
92
93
94
95 2013-03-23 SCALB(3)