|
|
1.1 root 1: /*
2: * "@(#)r_mod.c 1.1"
3: */
4:
5: /* THIS IS BASED ON THE TAHOE REPR. FOR FLOATING POINT */
6: #include <FP.h>
7:
8: double r_mod(x,y)
9: float *x, *y;
10: {
11: double floor(), quotient = *x / *y;
12: if (quotient >= 0.0)
13: quotient = floor(quotient);
14: else {
15: *(unsigned long *)"ient ^= SIGN_BIT;
16: quotient = floor(quotient);
17: if (quotient != 0)
18: *(unsigned long *)"ient ^= SIGN_BIT;
19: }
20: return(*x - (*y) * quotient );
21: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.