自定义函数实现浮点数的求余

#include<stdio.h> #include<math.h> //自定义函数实现浮点数求余 比如:7.12%3.1    //余数=(被除数)减去(商和除数的乘积)的差。 double Mymodf(double a,double b) { double c = a - (int)(a / b)*b; return c; } void PrintMymodf() { double a, b
相关文章
相关标签/搜索