|
Definition at line 37 of file recip.c.
References Divisors, _large_integer::HighPart, Index, L, and _large_integer::LowPart.
00040 {
00041
00042 large_integer Fraction;
00043 long Index;
00044 long NumberBits;
00045 long Remainder;
00046
00047 long i;
00048
00049
00050
00051
00052
00053 for ( Index = Divisors[i = 0]; Index != 0 L; Index = Divisors[++i]) {
00054 NumberBits = 0 L;
00055 Remainder = 1 L;
00056 Fraction. LowPart = 0 L;
00057 Fraction. HighPart = 0 L;
00058 while (Fraction. HighPart >= 0 L) {
00059 NumberBits += 1 L;
00060 Fraction. HighPart <<= 1 L;
00061 if ((Fraction. LowPart & 0x80000000) != 0 L) {
00062 Fraction. HighPart += 1 L;
00063 }
00064 Fraction. LowPart <<= 1 L;
00065 Remainder <<= 1 L;
00066 if (Remainder >= Index) {
00067 Remainder -= Index;
00068 Fraction. LowPart |= 1 L;
00069 }
00070 }
00071 if (Remainder) {
00072 if ((Fraction. LowPart == -1 L) && (Fraction. HighPart == -1 L)) {
00073 Fraction. LowPart = 0 L;
00074 Fraction. HighPart = 0x80000000;
00075 NumberBits -= 1 L;
00076 } else {
00077 if (Fraction. LowPart == -1 L) {
00078 Fraction. LowPart = 0 L;
00079 Fraction. HighPart += 1 L;
00080 } else {
00081 Fraction. LowPart += 1 L;
00082 }
00083 }
00084 }
00085
00086 printf( "Divisor %2ld, Fraction %8lx, %8lx Shift %ld\n", Index,
00087 Fraction. HighPart, Fraction. LowPart, NumberBits - 64L);
00088 }
00089
00090 return;
00091 }
|