fmod,fmodl

提供: RAD Studio
移動先: 案内検索

math.h:インデックス への移動


ヘッダーファイル

math.h

カテゴリ

演算ルーチン

プロトタイプ

double fmod(double x, double y);

long double fmodl(long double x, long double y);

説明

x を y で割った剰余を計算します。

fmod は,x を y で割った剰余を計算します(剰余 f は x = ay + f,a は整数,0 < f < y を満たす)。

fmodl は long double バージョンです。long double 引数を受け取り,long double の結果を返します。

戻り値

fmod および fmodl は,x = ay + f(上を参照)になる剰余 f を返します。y = 0 の場合,fmod および fmodl は 0 を返します。



 #include <stdio.h>
 #include <math.h>
 int main(void)
 {
    double x = 5.0, y = 2.0;
    double result;
    result = fmod(x,y);
    printf("The remainder of (%lf / %lf) is %lf\n", x, y, result);
    return 0;
 }



移植性



POSIX Win32 ANSI C ANSI C++

fmod

+

+

+

+

fmodl

+

+

+