diff options
author | Karl Berry <karl@freefriends.org> | 2012-05-18 00:35:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-05-18 00:35:36 +0000 |
commit | ff3def13189580da6fe5254355c8f3b8091bb0fb (patch) | |
tree | 13092e119e26dd5354f66cf3746dd0a0cbdd8cb2 /Build/source/utils/pmx/pmx-2.6.18/libf2c/r_mod.c | |
parent | 2721345a8954f1846ff48ba10e634bc65e7b954d (diff) |
pmx 2.6.18 (16may12)
git-svn-id: svn://tug.org/texlive/trunk@26478 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/pmx/pmx-2.6.18/libf2c/r_mod.c')
-rw-r--r-- | Build/source/utils/pmx/pmx-2.6.18/libf2c/r_mod.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Build/source/utils/pmx/pmx-2.6.18/libf2c/r_mod.c b/Build/source/utils/pmx/pmx-2.6.18/libf2c/r_mod.c new file mode 100644 index 00000000000..63ed1753689 --- /dev/null +++ b/Build/source/utils/pmx/pmx-2.6.18/libf2c/r_mod.c @@ -0,0 +1,46 @@ +#include "f2c.h" + +#ifdef KR_headers +#ifdef IEEE_drem +double drem(); +#else +double floor(); +#endif +double r_mod(x,y) real *x, *y; +#else +#ifdef IEEE_drem +double drem(double, double); +#else +#undef abs +#include "math.h" +#ifdef __cplusplus +extern "C" { +#endif +#endif +double r_mod(real *x, real *y) +#endif +{ +#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 +} +#ifdef __cplusplus +} +#endif |