diff options
author | peter <peter@FreeBSD.org> | 2008-06-01 00:03:21 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2008-06-01 00:03:21 +0000 |
commit | a2be5f0c15218b0177d73b17d9bcb7589965d685 (patch) | |
tree | c9f0cd9c22378356a1716d32e13e70bc90f98b9c /libf2c/libF77/r_mod.c | |
parent | 9e0f3cc19c9df1594c9cc36cfd8fddc83c52ad12 (diff) | |
download | FreeBSD-src-a2be5f0c15218b0177d73b17d9bcb7589965d685.zip FreeBSD-src-a2be5f0c15218b0177d73b17d9bcb7589965d685.tar.gz |
Reorganize the gcc vendor import work area. This flattens out a bunch
of unnecessary path components that are relics of cvs2svn.
(These are directory moves)
Diffstat (limited to 'libf2c/libF77/r_mod.c')
-rw-r--r-- | libf2c/libF77/r_mod.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libf2c/libF77/r_mod.c b/libf2c/libF77/r_mod.c new file mode 100644 index 0000000..9518d66 --- /dev/null +++ b/libf2c/libF77/r_mod.c @@ -0,0 +1,33 @@ +#include "f2c.h" + +#ifdef IEEE_drem +double drem (double, double); +#else +#undef abs +#include <math.h> +#endif +double +r_mod (real * x, real * 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; +#else + double quotient; + if ((quotient = (double) *x / *y) >= 0) + quotient = floor (quotient); + else + quotient = -floor (-quotient); + return (*x - (*y) * quotient); +#endif +} |