X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/95f51977ddc18faa2e212f30c00a39540b39f325..ca67e7b465996afb3821d6a075c4dc6a7f0f5d52:/usr/src/usr.lib/libF77/d_mod.c diff --git a/usr/src/usr.lib/libF77/d_mod.c b/usr/src/usr.lib/libF77/d_mod.c index 5a7431e118..db240a1e8b 100644 --- a/usr/src/usr.lib/libF77/d_mod.c +++ b/usr/src/usr.lib/libF77/d_mod.c @@ -3,8 +3,11 @@ * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * - * @(#)d_mod.c 5.1 6/7/85 + * @(#)d_mod.c 5.3 5/8/87 */ +#ifdef tahoe +#include +#endif tahoe double d_mod(x,y) double *x, *y; @@ -12,7 +15,15 @@ double *x, *y; double floor(), quotient = *x / *y; if (quotient >= 0.0) quotient = floor(quotient); -else +else { +#ifndef tahoe quotient = -floor(-quotient); +#else tahoe + *(unsigned long *)"ient ^= SIGN_BIT; + quotient = floor(quotient); + if (quotient !=0) + *(unsigned long *)"ient ^= SIGN_BIT; +#endif tahoe +} return(*x - (*y) * quotient ); }