summaryrefslogtreecommitdiffstats
path: root/contrib/libf2c/libF77/d_mod.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libf2c/libF77/d_mod.c')
-rw-r--r--contrib/libf2c/libF77/d_mod.c49
1 files changed, 21 insertions, 28 deletions
diff --git a/contrib/libf2c/libF77/d_mod.c b/contrib/libf2c/libF77/d_mod.c
index 23f1929..15cedef 100644
--- a/contrib/libf2c/libF77/d_mod.c
+++ b/contrib/libf2c/libF77/d_mod.c
@@ -1,40 +1,33 @@
#include "f2c.h"
-#ifdef KR_headers
#ifdef IEEE_drem
-double drem();
-#else
-double floor();
-#endif
-double d_mod(x,y) doublereal *x, *y;
-#else
-#ifdef IEEE_drem
-double drem(double, double);
+double drem (double, double);
#else
#undef abs
#include <math.h>
#endif
-double d_mod(doublereal *x, doublereal *y)
-#endif
+double
+d_mod (doublereal * x, doublereal * y)
{
#ifdef IEEE_drem
- double 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;
+ double 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;
#else
- double quotient;
- if( (quotient = *x / *y) >= 0)
- quotient = floor(quotient);
- else
- quotient = -floor(-quotient);
- return(*x - (*y) * quotient );
+ double quotient;
+ if ((quotient = *x / *y) >= 0)
+ quotient = floor (quotient);
+ else
+ quotient = -floor (-quotient);
+ return (*x - (*y) * quotient);
#endif
}
OpenPOWER on IntegriCloud