]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/scalbln.3
scalbln.3: Fixed feature test macro requirements
[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 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\"
25 .TH SCALBLN 3 2008-08-11 "" "Linux Programmer's Manual"
26 .SH NAME
27 scalbn, scalbnf, scalbnl, scalbln, scalblnf, scalblnl \-
28 multiply floating-point number by integral power of radix
29 .SH SYNOPSIS
30 .B #include <math.h>
31 .sp
32 .BI "double scalbln(double " x ", long int " exp );
33 .br
34 .BI "float scalblnf(float " x ", long int " exp );
35 .br
36 .BI "long double scalblnl(long double " x ", long int " exp );
37 .sp
38 .BI "double scalbn(double " x ", int " exp );
39 .br
40 .BI "float scalbnf(float " x ", int " exp );
41 .br
42 .BI "long double scalbnl(long double " x ", int " exp );
43 .sp
44 Link with \fI\-lm\fP.
45 .sp
46 .in -4n
47 Feature Test Macro Requirements for glibc (see
48 .BR feature_test_macros (7)):
49 .in
50 .sp
51 .ad l
52 .BR scalbln (),
53 .BR scalblnf (),
54 .BR scalblnl ():
55 .RS
56 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
57 _POSIX_C_SOURCE\ >=\ 200112L;
58 .br
59 or
60 .I cc\ -std=c99
61 .RE
62 .br
63 .BR scalbn (),
64 .BR scalbnf (),
65 .BR scalbnl ():
66 .RS
67 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
68 _POSIX_C_SOURCE\ >=\ 200112L;
69 .br
70 or
71 .I cc\ -std=c99
72 .RE
73 .ad b
74 .SH DESCRIPTION
75 These functions multiply their first argument
76 .I x
77 by
78 .B FLT_RADIX
79 (probably 2)
80 to the power of
81 .IR exp ,
82 that is:
83 .nf
84
85 x * FLT_RADIX ** exp
86 .fi
87
88 The definition of
89 .B FLT_RADIX
90 can be obtained by including
91 .IR <float.h> .
92 .\" not in /usr/include but in a gcc lib
93 .SH RETURN VALUE
94 On success, these functions return \fIx\fP * \fBFLT_RADIX\fP ** \fIexp\fP.
95
96 If
97 .I x
98 is a NaN, a NaN is returned.
99
100 If
101 .I x
102 is positive infinity (negative infinity),
103 positive infinity (negative infinity) is returned.
104
105 If
106 .I x
107 is +0 (\-0), +0 (\-0) is returned.
108
109 If the result overflows,
110 a range error occurs,
111 and the functions return
112 .BR HUGE_VAL ,
113 .BR HUGE_VALF ,
114 or
115 .BR HUGE_VALL ,
116 respectively, with a sign the same as
117 .IR x .
118
119 If the result underflows,
120 a range error occurs,
121 and the functions return zero, with a sign the same as
122 .IR x .
123 .SH ERRORS
124 See
125 .BR math_error (7)
126 for information on how to determine whether an error has occurred
127 when calling these functions.
128 .PP
129 The following errors can occur:
130 .TP
131 Range error, overflow
132 .\" .I errno
133 .\" is set to
134 .\" .BR ERANGE .
135 An overflow floating-point exception
136 .RB ( FE_OVERFLOW )
137 is raised.
138 .TP
139 Range error, underflow
140 .\" .I errno
141 .\" is set to
142 .\" .BR ERANGE .
143 An underflow floating-point exception
144 .RB ( FE_UNDERFLOW )
145 is raised.
146 .PP
147 These functions do not set
148 .IR errno .
149 .\" FIXME . Is it intentional that these functions do not set errno?
150 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803
151 .SH VERSIONS
152 These functions first appeared in glibc in version 2.1.
153 .SH "CONFORMING TO"
154 C99, POSIX.1-2001.
155 .SH NOTES
156 These functions differ from the obsolete functions described in
157 .BR scalb (3)
158 in the type of their second argument.
159 The functions described on this page have a second argument
160 of an integral type, while those in
161 .BR scalb (3)
162 have a second argument of type
163 .IR double .
164
165 If
166 .B FLT_RADIX
167 equals 2 (which is usual), then
168 .BR scalbn ()
169 is equivalent to
170 .BR ldexp (3).
171 .SH "SEE ALSO"
172 .BR ldexp (3),
173 .BR scalb (3)