OSDN Git Service

(split) LDP man-pages の original/ を v3.29 に更新。
[linuxjm/LDP_man-pages.git] / original / man3 / ldexp.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
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 .\" References consulted:
26 .\"     Linux libc source code
27 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
28 .\"     386BSD man pages
29 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
30 .\" Modified 2004-10-31 by aeb
31 .\"
32 .TH LDEXP 3 2010-09-20 "" "Linux Programmer's Manual"
33 .SH NAME
34 ldexp, ldexpf, ldexpl \- multiply floating-point number by integral power of 2
35 .SH SYNOPSIS
36 .nf
37 .B #include <math.h>
38 .sp
39 .BI "double ldexp(double " x ", int " exp );
40 .br
41 .BI "float ldexpf(float " x ", int " exp );
42 .br
43 .BI "long double ldexpl(long double " x ", int " exp );
44 .fi
45 .sp
46 Link with \fI\-lm\fP.
47 .sp
48 .in -4n
49 Feature Test Macro Requirements for glibc (see
50 .BR feature_test_macros (7)):
51 .in
52 .sp
53 .ad l
54 .BR ldexpf (),
55 .BR ldexpl ():
56 .RS 4
57 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
58 _POSIX_C_SOURCE\ >=\ 200112L;
59 .br
60 or
61 .I cc\ -std=c99
62 .RE
63 .ad
64 .SH DESCRIPTION
65 The
66 .BR ldexp ()
67 function returns the result of multiplying the floating-point number
68 .I x
69 by 2 raised to the power
70 .IR exp .
71 .SH RETURN VALUE
72 On success, these functions return
73 .IR "x * (2^exp)" .
74
75 If
76 .I exp
77 is zero, then
78 .I x
79 is returned.
80
81 If
82 .I x
83 is a NaN,
84 a NaN is returned.
85
86 If
87 .I x
88 is positive infinity (negative infinity),
89 positive infinity (negative infinity) is returned.
90
91 If the result underflows,
92 an  range error occurs,
93 and zero is returned.
94
95 If the result overflows,
96 a range error occurs,
97 and the functions return
98 .BR HUGE_VAL ,
99 .BR HUGE_VALF ,
100 or
101 .BR HUGE_VALL ,
102 respectively, with a sign the same as
103 .IR x .
104 .SH ERRORS
105 See
106 .BR math_error (7)
107 for information on how to determine whether an error has occurred
108 when calling these functions.
109 .PP
110 The following errors can occur:
111 .TP
112 Range error, overflow
113 .I errno
114 is set to
115 .BR ERANGE .
116 An overflow floating-point exception
117 .RB ( FE_OVERFLOW )
118 is raised.
119 .TP
120 Range error, underflow
121 .I errno
122 is set to
123 .BR ERANGE .
124 An underflow floating-point exception
125 .RB ( FE_UNDERFLOW )
126 is raised.
127 .SH "CONFORMING TO"
128 C99, POSIX.1-2001.
129 The variant returning
130 .I double
131 also conforms to
132 SVr4, 4.3BSD, C89.
133 .SH "SEE ALSO"
134 .BR frexp (3),
135 .BR modf (3),
136 .BR scalbln (3)