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