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 scalbn(), scalbnf(), scalbnl():
28 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
29 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
30 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
31
33 These functions multiply their first argument x by FLT_RADIX (probably
34 2) to the power of exp, that is:
35
36 x * FLT_RADIX ** exp
37
38 The definition of FLT_RADIX can be obtained by including <float.h>.
39
41 On success, these functions return x * FLT_RADIX ** exp.
42
43 If x is a NaN, a NaN is returned.
44
45 If x is positive infinity (negative infinity), positive infinity (nega‐
46 tive infinity) is returned.
47
48 If x is +0 (-0), +0 (-0) 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 re‐
55 turn 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 Range error, overflow
64 An overflow floating-point exception (FE_OVERFLOW) is raised.
65
66 Range error, underflow
67 errno is set to ERANGE. An underflow floating-point exception
68 (FE_UNDERFLOW) is raised.
69
71 These functions first appeared in glibc in version 2.1.
72
74 For an explanation of the terms used in this section, see at‐
75 tributes(7).
76
77 ┌──────────────────────────────────┬───────────────┬─────────┐
78 │Interface │ Attribute │ Value │
79 ├──────────────────────────────────┼───────────────┼─────────┤
80 │scalbn(), scalbnf(), scalbnl(), │ Thread safety │ MT-Safe │
81 │scalbln(), scalblnf(), scalblnl() │ │ │
82 └──────────────────────────────────┴───────────────┴─────────┘
84 C99, POSIX.1-2001, POSIX.1-2008.
85
87 These functions differ from the obsolete functions described in
88 scalb(3) in the type of their second argument. The functions described
89 on this page have a second argument of an integral type, while those in
90 scalb(3) have a second argument of type double.
91
92 If FLT_RADIX equals 2 (which is usual), then scalbn() is equivalent to
93 ldexp(3).
94
96 Before glibc 2.20, these functions did not set errno for range errors.
97
99 ldexp(3), scalb(3)
100
102 This page is part of release 5.10 of the Linux man-pages project. A
103 description of the project, information about reporting bugs, and the
104 latest version of this page, can be found at
105 https://www.kernel.org/doc/man-pages/.
106
107
108
109 2020-11-01 SCALBLN(3)