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