#include
#include
double MyFmod(double _X, double _Y)
{
return _X - (int)(_X / _Y) * _Y;
}
int main()
{
double x, y;
scanf_s("%lf%lf", &x, &y);
printf("MyFmod = %lf
", MyFmod(x, y));
printf("fmod = %lf
", fmod(x, y));
return 0;
}
运行结果: