OSDN Git Service

1ae2193f0c019143ebd35ec5679aab39ff11507b
[linuxjm/LDP_man-pages.git] / original / 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 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
56 .I cc\ -std=c99
57 .br
58 .BR scalbn (),
59 .BR scalbnf (),
60 .BR scalbnl ():
61 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
62 .I cc\ -std=c99
63 .ad b
64 .SH DESCRIPTION
65 These functions multiply their first argument
66 .I x
67 by
68 .B FLT_RADIX
69 (probably 2)
70 to the power of
71 .IR exp ,
72 that is:
73 .nf
74
75     x * FLT_RADIX ** exp
76 .fi
77
78 The definition of
79 .B FLT_RADIX
80 can be obtained by including
81 .IR <float.h> .
82 .\" not in /usr/include but in a gcc lib
83 .SH RETURN VALUE
84 On success, these functions return \fIx\fP * \fBFLT_RADIX\fP ** \fIexp\fP.
85
86 If
87 .I x
88 is a NaN, a NaN is returned.
89
90 If
91 .I x
92 is positive infinity (negative infinity),
93 positive infinity (negative infinity) is returned.
94
95 If
96 .I x
97 is +0 (\-0), +0 (\-0) is returned.
98
99 If the result overflows,
100 a range error occurs,
101 and the functions return
102 .BR HUGE_VAL ,
103 .BR HUGE_VALF ,
104 or
105 .BR HUGE_VALL ,
106 respectively, with a sign the same as
107 .IR x .
108
109 If the result underflows,
110 a range error occurs,
111 and the functions return zero, with a sign the same as
112 .IR x .
113 .SH ERRORS
114 See
115 .BR math_error (7)
116 for information on how to determine whether an error has occurred
117 when calling these functions.
118 .PP
119 The following errors can occur:
120 .TP
121 Range error, overflow
122 .\" .I errno
123 .\" is set to
124 .\" .BR ERANGE .
125 An overflow floating-point exception
126 .RB ( FE_OVERFLOW )
127 is raised.
128 .TP
129 Range error, underflow
130 .\" .I errno
131 .\" is set to
132 .\" .BR ERANGE .
133 An underflow floating-point exception
134 .RB ( FE_UNDERFLOW )
135 is raised.
136 .PP
137 These functions do not set
138 .IR errno .
139 .\" FIXME . Is it intentional that these functions do not set errno?
140 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803
141 .SH VERSIONS
142 These functions first appeared in glibc in version 2.1.
143 .SH "CONFORMING TO"
144 C99, POSIX.1-2001.
145 .SH NOTES
146 These functions differ from the obsolete functions described in
147 .BR scalb (3)
148 in the type of their second argument.
149 The functions described on this page have a second argument
150 of an integral type, while those in
151 .BR scalb (3)
152 have a second argument of type
153 .IR double .
154
155 If
156 .B FLT_RADIX
157 equals 2 (which is usual), then
158 .BR scalbn ()
159 is equivalent to
160 .BR ldexp (3).
161 .SH "SEE ALSO"
162 .BR ldexp (3),
163 .BR scalb (3)