source: branches/GNU/src/gcc/libf2c/libF77/d_mod.c@ 1391

Last change on this file since 1391 was 1391, checked in by bird, 22 years ago

GCC v3.3.3 sources.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 525 bytes
Line 
1#include "f2c.h"
2
3#ifdef IEEE_drem
4double drem (double, double);
5#else
6#undef abs
7#include <math.h>
8#endif
9double
10d_mod (doublereal * x, doublereal * y)
11{
12#ifdef IEEE_drem
13 double xa, ya, z;
14 if ((ya = *y) < 0.)
15 ya = -ya;
16 z = drem (xa = *x, ya);
17 if (xa > 0)
18 {
19 if (z < 0)
20 z += ya;
21 }
22 else if (z > 0)
23 z -= ya;
24 return z;
25#else
26 double quotient;
27 if ((quotient = *x / *y) >= 0)
28 quotient = floor (quotient);
29 else
30 quotient = -floor (-quotient);
31 return (*x - (*y) * quotient);
32#endif
33}
Note: See TracBrowser for help on using the repository browser.