fmod() | 您所在的位置:网站首页 › c语言中fmod函数 › fmod() |
C库函数double fmod(double x, double y)返回x除以y的剩余的值。 声明以下是fmod() 函数的声明。 double fmod(double x, double y) 参数x -- 这是除法分子IEX浮点值 i.e. x. y -- 这是浮动点值除法分母iey 返回值这个函数返回除以x / y的剩余值。 例子下面的例子显示了 fmod()函数的用法。 #include #include int main () { float a, b; int c; a = 9.2; b = 3.7; c = 2; printf("Remainder of %f / %d is %lf ", a, c, fmod(a,c)); printf("Remainder of %f / %f is %lf ", a, b, fmod(a,b)); return(0); }让我们编译和运行上面的程序,这将产生以下结果: Remainder of 9.200000 / 2 is 1.200000 Remainder of 9.200000 / 3.700000 is 1.800000上一篇: floor() - C函数 下一篇: - C语言标准库 |
CopyRight 2018-2019 实验室设备网 版权所有 |