110463Sdlw /* 222863Skre * Copyright (c) 1980 Regents of the University of California. 322863Skre * All rights reserved. The Berkeley software License Agreement 422863Skre * specifies the terms and conditions for redistribution. 522863Skre * 6*31042Ssam * @(#)d_mod.c 5.3 05/08/87 710463Sdlw */ 829963Smckusick #ifdef tahoe 929963Smckusick #include <tahoemath/FP.h> 1029963Smckusick #endif tahoe 1110463Sdlw 1210463Sdlw double d_mod(x,y) 1310463Sdlw double *x, *y; 1410463Sdlw { 1510463Sdlw double floor(), quotient = *x / *y; 1610463Sdlw if (quotient >= 0.0) 1710463Sdlw quotient = floor(quotient); 1829963Smckusick else { 1929963Smckusick #ifndef tahoe 2010463Sdlw quotient = -floor(-quotient); 2129963Smckusick #else tahoe 2229963Smckusick *(unsigned long *)"ient ^= SIGN_BIT; 2329963Smckusick quotient = floor(quotient); 2429963Smckusick if (quotient !=0) 2529963Smckusick *(unsigned long *)"ient ^= SIGN_BIT; 26*31042Ssam #endif tahoe 2729963Smckusick } 2810463Sdlw return(*x - (*y) * quotient ); 2910463Sdlw } 30