]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/scalbln.3
CPU_SET.3, INFINITY.3, __ppc_get_timebase.3, __ppc_set_ppr_med.3, __ppc_yield.3,...
[thirdparty/man-pages.git] / man3 / scalbln.3
CommitLineData
d65519e8
MK
1.\" Copyright 2004 Andries Brouwer <aeb@cwi.nl>.
2.\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3.\" <mtk.manpages@gmail.com>
4.\"
93015253 5.\" %%%LICENSE_START(VERBATIM)
d65519e8
MK
6.\" Permission is granted to make and distribute verbatim copies of this
7.\" manual provided the copyright notice and this permission notice are
8.\" preserved on all copies.
9.\"
10.\" Permission is granted to copy and distribute modified versions of this
11.\" manual under the conditions for verbatim copying, provided that the
12.\" entire resulting derived work is distributed under the terms of a
13.\" permission notice identical to this one.
14.\"
15.\" Since the Linux kernel and libraries are constantly changing, this
16.\" manual page may be incorrect or out-of-date. The author(s) assume no
17.\" responsibility for errors or omissions, or for damages resulting from
18.\" the use of the information contained herein. The author(s) may not
19.\" have taken the same level of care in the production of this manual,
20.\" which is licensed free of charge, as they might when working
21.\" professionally.
22.\"
23.\" Formatted or processed versions of this manual, if unaccompanied by
24.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 25.\" %%%LICENSE_END
d65519e8 26.\"
97986708 27.TH SCALBLN 3 2016-03-15 "" "Linux Programmer's Manual"
d65519e8
MK
28.SH NAME
29scalbn, scalbnf, scalbnl, scalbln, scalblnf, scalblnl \-
30multiply floating-point number by integral power of radix
31.SH SYNOPSIS
32.B #include <math.h>
68e4db0a 33.PP
d65519e8
MK
34.BI "double scalbln(double " x ", long int " exp );
35.br
36.BI "float scalblnf(float " x ", long int " exp );
37.br
38.BI "long double scalblnl(long double " x ", long int " exp );
68e4db0a 39.PP
d65519e8
MK
40.BI "double scalbn(double " x ", int " exp );
41.br
42.BI "float scalbnf(float " x ", int " exp );
43.br
44.BI "long double scalbnl(long double " x ", int " exp );
68e4db0a 45.PP
d65519e8 46Link with \fI\-lm\fP.
68e4db0a 47.PP
d65519e8
MK
48.in -4n
49Feature Test Macro Requirements for glibc (see
50.BR feature_test_macros (7)):
51.in
68e4db0a 52.PP
d65519e8
MK
53.ad l
54.BR scalbln (),
55.BR scalblnf (),
56.BR scalblnl ():
4b8e6548 57.RS
e464f054 58_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
636ed4d5 59 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
4b8e6548 60.RE
d65519e8
MK
61.br
62.BR scalbn (),
63.BR scalbnf (),
64.BR scalbnl ():
4b8e6548 65.RS
636ed4d5
MK
66_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
67 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
68 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
4b8e6548 69.RE
d65519e8
MK
70.ad b
71.SH DESCRIPTION
72These functions multiply their first argument
73.I x
74by
75.B FLT_RADIX
76(probably 2)
77to the power of
78.IR exp ,
79that is:
80.nf
81
82 x * FLT_RADIX ** exp
83.fi
847e0d88 84.PP
d65519e8
MK
85The definition of
86.B FLT_RADIX
87can be obtained by including
88.IR <float.h> .
89.\" not in /usr/include but in a gcc lib
90.SH RETURN VALUE
022671eb 91On success, these functions return
51700fd7 92.IR x
022671eb
MK
93*
94.B FLT_RADIX
95**
96.IR exp .
847e0d88 97.PP
d65519e8
MK
98If
99.I x
100is a NaN, a NaN is returned.
847e0d88 101.PP
d65519e8
MK
102If
103.I x
104is positive infinity (negative infinity),
105positive infinity (negative infinity) is returned.
847e0d88 106.PP
d65519e8
MK
107If
108.I x
109is +0 (\-0), +0 (\-0) is returned.
847e0d88 110.PP
d65519e8 111If the result overflows,
efe294cb 112a range error occurs,
d65519e8
MK
113and the functions return
114.BR HUGE_VAL ,
115.BR HUGE_VALF ,
116or
117.BR HUGE_VALL ,
118respectively, with a sign the same as
119.IR x .
847e0d88 120.PP
d65519e8 121If the result underflows,
efe294cb 122a range error occurs,
d65519e8
MK
123and the functions return zero, with a sign the same as
124.IR x .
125.SH ERRORS
126See
127.BR math_error (7)
128for information on how to determine whether an error has occurred
129when calling these functions.
130.PP
131The following errors can occur:
132.TP
133Range error, overflow
134.\" .I errno
135.\" is set to
136.\" .BR ERANGE .
137An overflow floating-point exception
138.RB ( FE_OVERFLOW )
139is raised.
140.TP
141Range error, underflow
142.\" .I errno
143.\" is set to
144.\" .BR ERANGE .
145An underflow floating-point exception
146.RB ( FE_UNDERFLOW )
147is raised.
148.PP
149These functions do not set
150.IR errno .
151.\" FIXME . Is it intentional that these functions do not set errno?
152.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803
f0d7ce1d
MK
153.SH VERSIONS
154These functions first appeared in glibc in version 2.1.
6d74e861 155.SH ATTRIBUTES
5880380f
PH
156For an explanation of the terms used in this section, see
157.BR attributes (7).
158.TS
159allbox;
160lbw33 lb lb
161l l l.
162Interface Attribute Value
163T{
6d74e861
PH
164.BR scalbn (),
165.BR scalbnf (),
166.BR scalbnl (),
5880380f 167.br
6d74e861
PH
168.BR scalbln (),
169.BR scalblnf (),
6d74e861 170.BR scalblnl ()
5880380f
PH
171T} Thread safety MT-Safe
172.TE
47297adb 173.SH CONFORMING TO
9a74e018 174C99, POSIX.1-2001, POSIX.1-2008.
d65519e8
MK
175.SH NOTES
176These functions differ from the obsolete functions described in
177.BR scalb (3)
178in the type of their second argument.
179The functions described on this page have a second argument
180of an integral type, while those in
181.BR scalb (3)
182have a second argument of type
183.IR double .
847e0d88 184.PP
d65519e8
MK
185If
186.B FLT_RADIX
187equals 2 (which is usual), then
188.BR scalbn ()
189is equivalent to
190.BR ldexp (3).
47297adb 191.SH SEE ALSO
d65519e8
MK
192.BR ldexp (3),
193.BR scalb (3)