OSDN Git Service

Update README
[linuxjm/LDP_man-pages.git] / draft / man3 / fmod.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 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .\" References consulted:
28 .\"     Linux libc source code
29 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
30 .\"     386BSD man pages
31 .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu)
32 .\" Modified 2002-07-27 by Walter Harms
33 .\"     (walter.harms@informatik.uni-oldenburg.de)
34 .\"
35 .\"*******************************************************************
36 .\"
37 .\" This file was generated with po4a. Translate the source file.
38 .\"
39 .\"*******************************************************************
40 .\"
41 .\" Japanese Version Copyright (c) 1997 YOSHINO Takashi
42 .\" and Copyright (c) 2008 Akihiro MOTOKI
43 .\" Translated Mon Jan 20 18:39:17 JST 1997
44 .\"       by YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
45 .\" Updated Wed Oct 15 JST 2003 by Kentaro Shirakata <argrath@ub32.org>
46 .\" Updated 2008-09-16, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
47 .\"
48 .TH FMOD 3 2012\-03\-15 "" "Linux Programmer's Manual"
49 .SH 名前
50 fmod, fmodf, fmodl \- 浮動小数点剰余関数
51 .SH 書式
52 .nf
53 \fB#include <math.h>\fP
54 .sp
55 \fBdouble fmod(double \fP\fIx\fP\fB, double \fP\fIy\fP\fB);\fP
56 .br
57 \fBfloat fmodf(float \fP\fIx\fP\fB, float \fP\fIy\fP\fB);\fP
58 .br
59 \fBlong double fmodl(long double \fP\fIx\fP\fB, long double \fP\fIy\fP\fB);\fP
60 .fi
61 .sp
62 \fI\-lm\fP でリンクする。
63 .sp
64 .in -4n
65 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
66 .in
67 .sp
68 .ad l
69 \fBfmodf\fP(), \fBfmodl\fP():
70 .RS 4
71 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE
72 || _POSIX_C_SOURCE\ >=\ 200112L;
73 .br
74 or \fIcc\ \-std=c99\fP
75 .RE
76 .ad
77 .SH 説明
78 \fBfmod\fP()  関数は \fIx\fP を \fIy\fP で割った浮動小数点剰余を計算する。 返り値は \fIx\fP \- \fIn\fP * \fIy\fP である。
79 ここで、\fIn\fP は \fIx\fP / \fIy\fP の商を ゼロに向かう方向で整数値に丸めたものである。
80 .SH 返り値
81 成功すると、これらの関数は \fIx\fP\ \-\ \fIn\fP*\fIy\fP を返す。 \fIn\fP は、返り値が \fIx\fP と同じ符号で、その絶対値が \fIy\fP
82 の絶対値よりも小さくなるような整数である。
83
84 \fIx\fP か \fIy\fP が NaN の場合、NaN が返される。
85
86 \fIx\fP が無限大の場合、領域エラー (domain error) が発生し、 NaN が返される。
87
88 \fIy\fP が 0 の場合、領域エラーが発生し、 NaN が返される。
89
90 \fIx\fP が +0 (\-0) で \fIy\fP が 0 でない場合、+0 (\-0) が返される。
91 .SH エラー
92 これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は \fBmath_error\fP(7)  を参照のこと。
93 .PP
94 以下のエラーが発生する可能性がある。
95 .TP 
96 領域エラー (domain error): \fIx\fP が無限大である
97 \fIerrno\fP に \fBEDOM\fP が設定される (「バグ」の節も参照)。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP)
98 が上がる。
99 .TP 
100 領域エラー: \fIy\fP がゼロ
101 .\" POSIX.1 documents an optional underflow error, but AFAICT it doesn't
102 .\" (can't?) occur -- mtk, Jul 2008
103 \fIerrno\fP に \fBEDOM\fP が設定される。 不正 (invalid) 浮動小数点例外 (\fBFE_INVALID\fP)  が上がる。
104 .SH 準拠
105 C99, POSIX.1\-2001.  \fIdouble\fP 版の関数は SVr4, 4.3BSD, C89 にも準拠している。
106 .SH バグ
107 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6784
108 バージョン 2.10 より前の glibc の実装では、 無限大で領域エラーが発生した際に、 \fIerrno\fP に \fBEDOM\fP が設定されなかった。
109 .SH 関連項目
110 \fBremainder\fP(3)
111 .SH この文書について
112 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
113 である。プロジェクトの説明とバグ報告に関する情報は
114 http://www.kernel.org/doc/man\-pages/ に書かれている。