mp multiple-digit arithmetic

gae at osupyr.UUCP gae at osupyr.UUCP
Sat Feb 28 22:40:17 AEST 1987


Is there (another) problem with the mp multiple-digit routines, or am I
misunderstanding something?
In my opinion, 2 raised to the power 3 does not have thousands of digits.

/* bug in rpow ??? */

#include <stdio.h>
#include <mp.h>

int base,exp;
MINT *temp1,*temp2,*result;

main()
	{
	result = itom(0);
	base = 2;
	exp = 3;
	temp1=itom(base);temp2=itom(exp);
	printf("base=");
	printf("(length %d)\n",temp1->len);
	mout(temp1);
	printf(" exp=");
	printf("(length %d)\n",temp2->len);
	mout(temp2);
	rpow(temp1,temp2,result);
	printf("  result=");
	printf("(length %d)\n",result->len);
	mout(result);
	exit(0);
	}


-- 

  Gerald A. Edgar                               TS1871 at OHSTMVA.bitnet
  Department of Mathematics                     edgar at osupyr.UUCP
  The Ohio State University
  Columbus, OH 43210                            70715,1324  CompuServe



More information about the Comp.unix.questions mailing list