public
/
Ack-5.5.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Pristine Ack-5.5
[Ack-5.5.git]
/
lang
/
fortran
/
lib
/
libF77
/
d_mod.c
1
#include "f2c.h"
2
3
double d_mod(x,y)
4
doublereal *x, *y;
5
{
6
#ifdef IEEE_drem
7
double drem(), xa, ya, z;
8
if ((ya = *y) < 0.)
9
ya = -ya;
10
z = drem(xa = *x, ya);
11
if (xa > 0) {
12
if (z < 0)
13
z += ya;
14
}
15
else if (z > 0)
16
z -= ya;
17
return z;
18
#else
19
double floor(), quotient;
20
if( (quotient = *x / *y) >= 0)
21
quotient = floor(quotient);
22
else
23
quotient = -floor(-quotient);
24
return(*x - (*y) * quotient );
25
#endif
26
}