1SCALBLN(3) Linux Programmer's Manual SCALBLN(3)
2
3
4
6 scalbn, scalbnf, scalbnl, scalbln, scalblnf, scalblnl - multiply float‐
7 ing-point number by integral power of radix
8
10 #include <math.h>
11
12 double scalbln(double x, long exp);
13 float scalblnf(float x, long exp);
14 long double scalblnl(long double x, long exp);
15
16 double scalbn(double x, int exp);
17 float scalbnf(float x, int exp);
18 long double scalbnl(long double x, int exp);
19
20 Link with -lm.
21
22 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
23
24 scalbln(), scalblnf(), scalblnl():
25 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
26 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
27
28 scalbn(), scalbnf(), scalbnl():
29 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
30 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
31 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
32
34 These functions multiply their first argument x by FLT_RADIX (probably
35 2) to the power of exp, that is:
36
37 x * FLT_RADIX ** exp
38
39 The definition of FLT_RADIX can be obtained by including <float.h>.
40
42 On success, these functions return x * FLT_RADIX ** exp.
43
44 If x is a NaN, a NaN is returned.
45
46 If x is positive infinity (negative infinity), positive infinity (nega‐
47 tive infinity) is returned.
48
49 If x is +0 (-0), +0 (-0) is returned.
50
51 If the result overflows, a range error occurs, and the functions return
52 HUGE_VAL, HUGE_VALF, or HUGE_VALL, respectively, with a sign the same
53 as x.
54
55 If the result underflows, a range error occurs, and the functions re‐
56 turn zero, with a sign the same as x.
57
59 See math_error(7) for information on how to determine whether an error
60 has occurred when calling these functions.
61
62 The following errors can occur:
63
64 Range error, overflow
65 An overflow floating-point exception (FE_OVERFLOW) is raised.
66
67 Range error, underflow
68 errno is set to ERANGE. An underflow floating-point exception
69 (FE_UNDERFLOW) is raised.
70
72 These functions first appeared in glibc in version 2.1.
73
75 For an explanation of the terms used in this section, see at‐
76 tributes(7).
77
78 ┌────────────────────────────────────────────┬───────────────┬─────────┐
79 │Interface │ Attribute │ Value │
80 ├────────────────────────────────────────────┼───────────────┼─────────┤
81 │scalbn(), scalbnf(), scalbnl(), scalbln(), │ Thread safety │ MT-Safe │
82 │scalblnf(), scalblnl() │ │ │
83 └────────────────────────────────────────────┴───────────────┴─────────┘
84
86 C99, POSIX.1-2001, POSIX.1-2008.
87
89 These functions differ from the obsolete functions described in
90 scalb(3) in the type of their second argument. The functions described
91 on this page have a second argument of an integral type, while those in
92 scalb(3) have a second argument of type double.
93
94 If FLT_RADIX equals 2 (which is usual), then scalbn() is equivalent to
95 ldexp(3).
96
98 Before glibc 2.20, these functions did not set errno for range errors.
99
101 ldexp(3), scalb(3)
102
104 This page is part of release 5.13 of the Linux man-pages project. A
105 description of the project, information about reporting bugs, and the
106 latest version of this page, can be found at
107 https://www.kernel.org/doc/man-pages/.
108
109
110
111 2021-03-22 SCALBLN(3)