fmod

Autres langues

Langue: ja

Autres versions - même langue

Version: 2002-07-27 (fedora - 25/11/07)

Section: 3 (Bibliothèques de fonctions)

名前

fmod, fmodf, fmodl - 浮動小数点剰余関数

書式

 #include <math.h>
 
 double fmod(double x, double y);
 
float fmodf(float x, float y);
long double fmodl(long double x, long double y);

-lm でリンクする。

説明

fmod() 関数はxyで割った余りを計算する。 返り値はx - n * yである。 ここで、nx / yの商であり、 ゼロに向かって整数値に丸めたものである。

返り値

fmod() 関数は、 yがゼロの場合は失敗し、errnoが設定される。 そうでなければ余りを返す。

エラー

EDOM
除数yがゼロである。

準拠

SVr4, 4.3BSD, C89. float 版と long double 版は C99 の要求仕様である。

関連項目

remainder(3)