MPdivI

advertisement
MPdivI
The original MPdivI was written solely to help with MPOUT, the routine for
turning MP values into characters. In ExpLn.doc - tmexps.wpj – the exponent is divided
down by a very large integer, 2k, and then moved back up by k squarings. It is important
that no digits are lost in the division. There are 6 extra levels in mpdivi. This is
sufficient for no loss of precision for IDIV < 163846 = 214*6 which is > than the largest
integer.
Mult by large integer.doc
12/31/2007
mpbob.for
DO I=1,IT+4
IT1=ABS(IXT(I))/ABS(IDIV)
IREM=ABS(IXT(I))-IT1*ABS(IDIV)
IXT(I)=SIGN(IT1,IXT(I)*IST)
IXT(I+1)=IXT(I+1)+SIGN(IREM*IB,IXT(I)*IST)
ENDDO
In the loop above, it must always be possible to form IREM*IB. For large IDIV, IT1 is
zero, making IREM=IXT(I) and thus IXT(I+1)=b*IXT(I), this puts a practical limit of
IDIV < 215 = 32768.
Download