.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk .\" .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified 1993-07-24 by Rik Faith (faith@cs.unc.edu) .\" Modified 2002-07-27 by Walter Harms .\" (walter.harms@informatik.uni-oldenburg.de) .\" .\" Japanese Version Copyright (c) 1997 YOSHINO Takashi .\" and Copyright (c) 2008 Akihiro MOTOKI .\" Translated Mon Jan 20 18:39:17 JST 1997 .\" by YOSHINO Takashi .\" Updated Wed Oct 15 JST 2003 by Kentaro Shirakata .\" Updated 2008-09-16, Akihiro MOTOKI .\" .\" WORD: remainder function 剰余関数 .\" .TH FMOD 3 2010-09-20 "" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O fmod, fmodf, fmodl \- floating-point remainder function fmod, fmodf, fmodl \- 浮動小数点剰余関数 .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "double fmod(double " x ", double " y ); .br .BI "float fmodf(float " x ", float " y ); .br .BI "long double fmodl(long double " x ", long double " y ); .fi .sp .\"O Link with \fI\-lm\fP. \fI\-lm\fP でリンクする。 .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .ad l .BR fmodf (), .BR fmodl (): .RS 4 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L; .br or .I cc\ -std=c99 .RE .ad .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR fmod () .\"O function computes the floating-point remainder of dividing \fIx\fP by .\"O \fIy\fP. .\"O The return value is \fIx\fP \- \fIn\fP * \fIy\fP, where \fIn\fP .\"O is the quotient of \fIx\fP / \fIy\fP, rounded toward zero to an integer. .BR fmod () 関数は \fIx\fP を \fIy\fP で割った浮動小数点剰余を計算する。 返り値は \fIx\fP \- \fIn\fP * \fIy\fP である。 ここで、\fIn\fP は \fIx\fP / \fIy\fP の商を ゼロに向かう方向で整数値に丸めたものである。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O On success, these .\"O functions return the value \fIx\fP\ \-\ \fIn\fP*\fIy\fP, .\"O for some integer \fIn\fP, .\"O such that the returned value has the same sign as .\"O .I x .\"O and a magnitude less than the magnitude of .\"O .IR y . 成功すると、これらの関数は \fIx\fP\ \-\ \fIn\fP*\fIy\fP を返す。 \fIn\fP は、返り値が .I x と同じ符号で、その絶対値が .I y の絶対値よりも小さくなるような整数である。 .\"O If .\"O .I x .\"O or .\"O .I y .\"O is a NaN, a NaN is returned. .I x か .I y が NaN の場合、NaN が返される。 .\"O If .\"O .I x .\"O is an infinity, .\"O a domain error occurs, and .\"O a NaN is returned. .I x が無限大の場合、領域エラー (domain error) が発生し、 NaN が返される。 .\"O If .\"O .I y .\"O is zero, .\"O a domain error occurs, and .\"O a NaN is returned. .I y が 0 の場合、領域エラーが発生し、 NaN が返される。 .\"O If .\"O .I x .\"O is +0 (\-0), and .\"O .I y .\"O is not zero, +0 (\-0) is returned. .I x が +0 (\-0) で .I y が 0 でない場合、+0 (\-0) が返される。 .\"O .SH ERRORS .SH エラー .\"O See .\"O .BR math_error (7) .\"O for information on how to determine whether an error has occurred .\"O when calling these functions. これらの関数を呼び出した際にエラーが発生したかの判定方法についての情報は .BR math_error (7) を参照のこと。 .PP .\"O The following errors can occur: 以下のエラーが発生する可能性がある。 .TP .\"O Domain error: \fIx\fP is an infinity 領域エラー: \fIx\fP が無限大 .\"O .I errno .\"O is set to .\"O .BR EDOM .\"O (but see BUGS). .\"O An invalid floating-point exception .\"O .RB ( FE_INVALID ) .\"O is raised. .I errno に .B EDOM が設定される (「バグ」の節も参照)。 不正 (invalid) 浮動小数点例外 .RB ( FE_INVALID ) が上がる。 .TP .\"O Domain error: \fIy\fP is zero 領域エラー: \fIy\fP がゼロ .\"O .I errno .\"O is set to .\"O .BR EDOM . .\"O An invalid floating-point exception .\"O .RB ( FE_INVALID ) .\"O is raised. .I errno に .B EDOM が設定される。 不正 (invalid) 浮動小数点例外 .RB ( FE_INVALID ) が上がる。 .\" POSIX.1 documents an optional underflow error, but AFAICT it doesn't .\" (can't?) occur -- mtk, Jul 2008 .\"O .SH BUGS .SH バグ .\"O Before version 2.10, the glibc implementation did not set .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6784 .\"O .I errno .\"O to .\"O .B EDOM .\"O when a domain error occurred for an infinite .\"O .IR x . バージョン 2.10 より前の glibc の実装では、 無限大で領域エラーが発生した際に、 .I error に .B EDOM が設定されなかった。 .\"O .SH "CONFORMING TO" .SH 準拠 C99, POSIX.1-2001. .\"O The variant returning .\"O .I double .\"O also conforms to .\"O SVr4, 4.3BSD, C89. .I double 版の関数は SVr4, 4.3BSD, C89 にも準拠している。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR remainder (3)