|
|
Power 6/32 Unix version 1.21
/*
* "@(#)r_mod.c 1.1"
*/
/* THIS IS BASED ON THE TAHOE REPR. FOR FLOATING POINT */
#include <FP.h>
double r_mod(x,y)
float *x, *y;
{
double floor(), quotient = *x / *y;
if (quotient >= 0.0)
quotient = floor(quotient);
else {
*(unsigned long *)"ient ^= SIGN_BIT;
quotient = floor(quotient);
if (quotient != 0)
*(unsigned long *)"ient ^= SIGN_BIT;
}
return(*x - (*y) * quotient );
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.