1SCALB(3)                   Linux Programmer's Manual                  SCALB(3)
2
3
4

NAME

6       scalb,  scalbf,  scalbl  -  multiply  floating-point number by integral
7       power of radix (OBSOLETE)
8

SYNOPSIS

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 <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
24
25       scalbf(), scalbl():
26           _XOPEN_SOURCE >= 600
27               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
28               || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
29

DESCRIPTION

31       These functions multiply their first argument x by FLT_RADIX  (probably
32       2) to the power of exp, that is:
33
34           x * FLT_RADIX ** exp
35
36       The definition of FLT_RADIX can be obtained by including <float.h>.
37

RETURN VALUE

39       On success, these functions return x * FLT_RADIX ** exp.
40
41       If x or exp is a NaN, a NaN is returned.
42
43       If  x is positive infinity (negative infinity), and exp is not negative
44       infinity, positive infinity (negative infinity) is returned.
45
46       If x is +0 (-0), and exp is not positive infinity, +0 (-0) is returned.
47
48       If x is zero, and exp is positive infinity, a domain error occurs,  and
49       a NaN is returned.
50
51       If  x  is an infinity, and exp is negative infinity, a domain error oc‐
52       curs, and a NaN is returned.
53
54       If the result overflows, a range error occurs, and the functions return
55       HUGE_VAL,  HUGE_VALF,  or HUGE_VALL, respectively, with a sign the same
56       as x.
57
58       If the result underflows, a range error occurs, and the  functions  re‐
59       turn zero, with a sign the same as x.
60

ERRORS

62       See  math_error(7) for information on how to determine whether an error
63       has occurred when calling these functions.
64
65       The following errors can occur:
66
67       Domain error: x is 0, and exp is positive infinity, or  x  is  positive
68       infinity  and  exp is negative infinity and the other argument is not a
69       NaN
70              errno is set  to  EDOM.   An  invalid  floating-point  exception
71              (FE_INVALID) is raised.
72
73       Range error, overflow
74              errno  is  set  to ERANGE.  An overflow floating-point exception
75              (FE_OVERFLOW) is raised.
76
77       Range error, underflow
78              errno is set to ERANGE.  An underflow  floating-point  exception
79              (FE_UNDERFLOW) is raised.
80

ATTRIBUTES

82       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
83       tributes(7).
84
85       ┌────────────────────────────────────────────┬───────────────┬─────────┐
86Interface                                   Attribute     Value   
87       ├────────────────────────────────────────────┼───────────────┼─────────┤
88scalb(), scalbf(), scalbl()                 │ Thread safety │ MT-Safe │
89       └────────────────────────────────────────────┴───────────────┴─────────┘
90

CONFORMING TO

92       scalb()  is  specified  in  POSIX.1-2001,   but   marked   obsolescent.
93       POSIX.1-2008 removes the specification of scalb(), recommending the use
94       of scalbln(3), scalblnf(3), or scalblnl(3) instead.  The scalb()  func‐
95       tion is from 4.3BSD.
96
97       scalbf()  and  scalbl()  are  unstandardized;  scalbf() is nevertheless
98       present on several other systems
99

BUGS

101       Before glibc 2.20, these functions did not set  errno  for  domain  and
102       range errors.
103

SEE ALSO

105       ldexp(3), scalbln(3)
106

COLOPHON

108       This  page  is  part of release 5.13 of the Linux man-pages project.  A
109       description of the project, information about reporting bugs,  and  the
110       latest     version     of     this    page,    can    be    found    at
111       https://www.kernel.org/doc/man-pages/.
112
113
114
115                                  2021-03-22                          SCALB(3)
Impressum