OSDN Git Service

(split) LDP: Update release pages
[linuxjm/LDP_man-pages.git] / release / man3 / frexp.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
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 2002-07-27 by Walter Harms
31 .\"     (walter.harms@informatik.uni-oldenburg.de)
32 .\"
33 .\"*******************************************************************
34 .\"
35 .\" This file was generated with po4a. Translate the source file.
36 .\"
37 .\"*******************************************************************
38 .\"
39 .\" Japanese Version Copyright (c) 1997 YOSHINO Takashi
40 .\"       all rights reserved.
41 .\" Translated 1997-01-21, YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
42 .\" Updated 2003-10-15, Kentaro Shirakata <argrath@ub32.org>
43 .\" Updated 2005-11-19, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
44 .\"
45 .TH FREXP 3 2013\-08\-06 "" "Linux Programmer's Manual"
46 .SH 名前
47 frexp, frexpf, frexpl \- 浮動小数点実数を小数成分と整数成分に変換する
48 .SH 書式
49 .nf
50 \fB#include <math.h>\fP
51 .sp
52 \fBdouble frexp(double \fP\fIx\fP\fB, int *\fP\fIexp\fP\fB);\fP
53 .br
54 \fBfloat frexpf(float \fP\fIx\fP\fB, int *\fP\fIexp\fP\fB);\fP
55 .br
56 \fBlong double frexpl(long double \fP\fIx\fP\fB, int *\fP\fIexp\fP\fB);\fP
57 .fi
58 .sp
59 \fI\-lm\fP でリンクする。
60 .sp
61 .in -4n
62 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
63 .in
64 .sp
65 .ad l
66 \fBfrexpf\fP(), \fBfrexpl\fP():
67 .RS 4
68 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE
69 || _POSIX_C_SOURCE\ >=\ 200112L;
70 .br
71 or \fIcc\ \-std=c99\fP
72 .RE
73 .ad
74 .SH 説明
75 \fBfrexp\fP()  関数は浮動小数点実数 \fIx\fP を正規化小数と指数に分解し、 指数を *\fIexp\fP に格納する。
76 .SH 返り値
77 \fBfrexp\fP()  関数は正規化小数を返す。 引数 \fIx\fP がゼロでない場合、この正規化小数は \fIx\fP に 2
78 の累乗を乗じたものであり、その絶対値は 常に 1/2 以上 1 未満、つまり [0.5,1) となる。
79
80 \fIx\fP がゼロの場合、正規化小数はゼロになり *\fIexp\fP にはゼロが格納される。
81
82 \fIx\fP が NaN の場合、NaN が返される。 \fI*exp\fP の値は不定である。
83
84 \fIx\fP が正の無限大 (負の無限大) の場合、 正の無限大 (負の無限大) が返される。 \fI*exp\fP の値は不定である。
85 .SH エラー
86 エラーは発生しない。
87 .SH 属性
88 .SS "マルチスレッディング (pthreads(7) 参照)"
89 関数 \fBfrexp\fP(), \fBfrexpf\fP(), \fBfrexpl\fP() はスレッドセーフである。
90 .SH 準拠
91 C99, POSIX.1\-2001.  \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。
92 .SH 例
93 このプログラムを実行すると以下のような結果となる:
94 .sp
95 .nf
96 .in +4n
97 $\fB ./a.out 2560\fP
98 frexp(2560, &e) = 0.625: 0.625 * 2^12 = 2560
99 $\fB ./a.out \-4\fP
100 frexp(\-4, &e) = \-0.5: \-0.5 * 2^3 = \-4
101 .in
102 .fi
103 .SS プログラムのソース
104 \&
105 .nf
106 #include <math.h>
107 #include <float.h>
108 #include <stdio.h>
109 #include <stdlib.h>
110
111 int
112 main(int argc, char *argv[])
113 {
114     double x, r;
115     int exp;
116
117     x = strtod(argv[1], NULL);
118     r = frexp(x, &exp);
119
120     printf("frexp(%g, &e) = %g: %g * %d^%d = %g\en",
121            x, r, r, FLT_RADIX, exp, x);
122     exit(EXIT_SUCCESS);
123 }
124 .fi
125 .SH 関連項目
126 \fBldexp\fP(3), \fBmodf\fP(3)
127 .SH この文書について
128 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
129 である。プロジェクトの説明とバグ報告に関する情報は
130 http://www.kernel.org/doc/man\-pages/ に書かれている。