OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man3 / frexp.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" References consulted:
24 .\"     Linux libc source code
25 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
26 .\"     386BSD man pages
27 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
28 .\" Modified 2002-07-27 by Walter Harms
29 .\"     (walter.harms@informatik.uni-oldenburg.de)
30 .\"
31 .\"*******************************************************************
32 .\"
33 .\" This file was generated with po4a. Translate the source file.
34 .\"
35 .\"*******************************************************************
36 .TH FREXP 3 2010\-09\-20 "" "Linux Programmer's Manual"
37 .SH 名前
38 frexp, frexpf, frexpl \- 浮動小数点実数を小数成分と整数成分に変換する
39 .SH 書式
40 .nf
41 \fB#include <math.h>\fP
42 .sp
43 \fBdouble frexp(double \fP\fIx\fP\fB, int *\fP\fIexp\fP\fB);\fP
44 .br
45 \fBfloat frexpf(float \fP\fIx\fP\fB, int *\fP\fIexp\fP\fB);\fP
46 .br
47 \fBlong double frexpl(long double \fP\fIx\fP\fB, int *\fP\fIexp\fP\fB);\fP
48 .fi
49 .sp
50 \fI\-lm\fP でリンクする。
51 .sp
52 .in -4n
53 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
54 .in
55 .sp
56 .ad l
57 \fBfrexpf\fP(), \fBfrexpl\fP():
58 .RS 4
59 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE
60 || _POSIX_C_SOURCE\ >=\ 200112L;
61 .br
62 or \fIcc\ \-std=c99\fP
63 .RE
64 .ad
65 .SH 説明
66 \fBfrexp\fP()  関数は浮動小数点実数 \fIx\fP を正規化小数と指数に分解し、 指数を *\fIexp\fP に格納する。
67 .SH 返り値
68 \fBfrexp\fP()  関数は正規化小数を返す。 引数 \fIx\fP がゼロでない場合、この正規化小数は \fIx\fP に 2
69 の累乗を乗じたものであり、その絶対値は 常に 1/2 以上 1 未満、つまり [0.5,1) となる。
70
71 \fIx\fP がゼロの場合、正規化小数はゼロになり *\fIexp\fP にはゼロが格納される。
72
73 \fIx\fP が NaN の場合、NaN が返される。 \fI*exp\fP の値は不定である。
74
75 \fIx\fP が正の無限大 (負の無限大) の場合、 正の無限大 (負の無限大) が返される。 \fI*exp\fP の値は不定である。
76 .SH エラー
77 エラーは発生しない。
78 .SH 準拠
79 C99, POSIX.1\-2001.  \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。
80 .SH 例
81 このプログラムを実行すると以下のような結果となる:
82 .sp
83 .nf
84 .in +4n
85 $\fB ./a.out 2560\fP
86 frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560
87 $\fB ./a.out \-4\fP
88 frexp(\-4, &e) = \-0.5: \-0.5 * 2^3 = \-4
89 .in
90 .fi
91 .SS プログラムのソース
92 \&
93 .nf
94 #include <math.h>
95 #include <float.h>
96 #include <stdio.h>
97 #include <stdlib.h>
98
99 int
100 main(int argc, char *argv[])
101 {
102     double x, r;
103     int exp;
104
105     x = strtod(argv[1], NULL);
106     r = frexp(x, &exp);
107
108     printf("frexp(%g, &e) = %g: %g * %d^%d = %g\en",
109            x, r, r, FLT_RADIX, exp, x);
110     exit(EXIT_SUCCESS);
111 }
112 .fi
113 .SH 関連項目
114 \fBldexp\fP(3), \fBmodf\fP(3)