#include "f2c.h"#ifdef KR_headers#ifdef IEEE_dremdouble drem();#elsedouble floor();#endifdouble d_mod(x,y) doublereal *x, *y;#else#ifdef IEEE_dremdouble drem(double, double);#else#undef abs#include <math.h>#endifdouble d_mod(doublereal *x, doublereal *y)#endif{#ifdef IEEE_dremdouble xa, ya, z;if ((ya = *y) < 0.)ya = -ya;z = drem(xa = *x, ya);if (xa > 0) {if (z < 0)z += ya;}else if (z > 0)z -= ya;return z;#elsedouble quotient;if( (quotient = *x / *y) >= 0)quotient = floor(quotient);elsequotient = -floor(-quotient);return(*x - (*y) * quotient );#endif}