]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/scalbln.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / scalbln.3
1 .\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\" <mtk.manpages@gmail.com>
4 .\"
5 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\"
7 .TH SCALBLN 3 2021-03-22 "Linux man-pages (unreleased)"
8 .SH NAME
9 scalbn, scalbnf, scalbnl, scalbln, scalblnf, scalblnl \-
10 multiply floating-point number by integral power of radix
11 .SH LIBRARY
12 Math library
13 .RI ( libm ", " \-lm )
14 .SH SYNOPSIS
15 .nf
16 .B #include <math.h>
17 .PP
18 .BI "double scalbln(double " x ", long " exp );
19 .BI "float scalblnf(float " x ", long " exp );
20 .BI "long double scalblnl(long double " x ", long " exp );
21 .PP
22 .BI "double scalbn(double " x ", int " exp );
23 .BI "float scalbnf(float " x ", int " exp );
24 .BI "long double scalbnl(long double " x ", int " exp );
25 .fi
26 .PP
27 .RS -4
28 Feature Test Macro Requirements for glibc (see
29 .BR feature_test_macros (7)):
30 .RE
31 .PP
32 .BR scalbln (),
33 .BR scalblnf (),
34 .BR scalblnl ():
35 .nf
36 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
37 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
38 .fi
39 .PP
40 .BR scalbn (),
41 .BR scalbnf (),
42 .BR scalbnl ():
43 .nf
44 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
45 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
46 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
47 .fi
48 .SH DESCRIPTION
49 These functions multiply their first argument
50 .I x
51 by
52 .B FLT_RADIX
53 (probably 2)
54 to the power of
55 .IR exp ,
56 that is:
57 .PP
58 .nf
59 x * FLT_RADIX ** exp
60 .fi
61 .PP
62 The definition of
63 .B FLT_RADIX
64 can be obtained by including
65 .IR <float.h> .
66 .\" not in /usr/include but in a gcc lib
67 .SH RETURN VALUE
68 On success, these functions return
69 .I x
70 *
71 .B FLT_RADIX
72 **
73 .IR exp .
74 .PP
75 If
76 .I x
77 is a NaN, a NaN is returned.
78 .PP
79 If
80 .I x
81 is positive infinity (negative infinity),
82 positive infinity (negative infinity) is returned.
83 .PP
84 If
85 .I x
86 is +0 (\-0), +0 (\-0) is returned.
87 .PP
88 If the result overflows,
89 a range error occurs,
90 and the functions return
91 .BR HUGE_VAL ,
92 .BR HUGE_VALF ,
93 or
94 .BR HUGE_VALL ,
95 respectively, with a sign the same as
96 .IR x .
97 .PP
98 If the result underflows,
99 a range error occurs,
100 and the functions return zero, with a sign the same as
101 .IR x .
102 .SH ERRORS
103 See
104 .BR math_error (7)
105 for information on how to determine whether an error has occurred
106 when calling these functions.
107 .PP
108 The following errors can occur:
109 .TP
110 Range error, overflow
111 .\" .I errno
112 .\" is set to
113 .\" .BR ERANGE .
114 An overflow floating-point exception
115 .RB ( FE_OVERFLOW )
116 is raised.
117 .TP
118 Range error, underflow
119 .I errno
120 is set to
121 .BR ERANGE .
122 An underflow floating-point exception
123 .RB ( FE_UNDERFLOW )
124 is raised.
125 .SH VERSIONS
126 These functions first appeared in glibc in version 2.1.
127 .SH ATTRIBUTES
128 For an explanation of the terms used in this section, see
129 .BR attributes (7).
130 .ad l
131 .nh
132 .TS
133 allbox;
134 lbx lb lb
135 l l l.
136 Interface Attribute Value
137 T{
138 .BR scalbn (),
139 .BR scalbnf (),
140 .BR scalbnl (),
141 .BR scalbln (),
142 .BR scalblnf (),
143 .BR scalblnl ()
144 T} Thread safety MT-Safe
145 .TE
146 .hy
147 .ad
148 .sp 1
149 .SH STANDARDS
150 C99, POSIX.1-2001, POSIX.1-2008.
151 .SH NOTES
152 These functions differ from the obsolete functions described in
153 .BR scalb (3)
154 in the type of their second argument.
155 The functions described on this page have a second argument
156 of an integral type, while those in
157 .BR scalb (3)
158 have a second argument of type
159 .IR double .
160 .PP
161 If
162 .B FLT_RADIX
163 equals 2 (which is usual), then
164 .BR scalbn ()
165 is equivalent to
166 .BR ldexp (3).
167 .SH BUGS
168 Before glibc 2.20,
169 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803
170 these functions did not set
171 .I errno
172 for range errors.
173 .SH SEE ALSO
174 .BR ldexp (3),
175 .BR scalb (3)