mp multiple-digit arithmetic

donn at utah-gr.UUCP donn at utah-gr.UUCP
Sun Mar 1 20:39:59 AEST 1987


Gerald Edgar asks:

	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.

I didn't realize anyone actually used this library...

The manual page for mp(3X) in the Seventh Edition reports that 'rpow
calculates a raised to the power b', where 'a' and 'b' are both 'mint'
pointers.  I have access to a copy of the Unix 32/V sources and it
appears that the Seventh Edition description is incorrect -- the second
argument to rpow() is an ordinary int exponent.  (Also, 'mp.h' defines
a type 'MINT', not 'mint'; this is one of those situations in which
case distinction in C raises its ornery head.)  I can't tell whether
the mp library changed between the Seventh Edition and 32/V -- anyone
out there know mp's pedigree?  The dates on the 32/V sources are the
same as the date on the Seventh Edition UPM (January 1979).

When 4.3 BSD was a few months from release, some final checks were made
for consistency across lint libraries, manual pages and sources.  We
discovered that the manual page for mp(3X) was missing -- the page
doesn't appear in the copy of the 32/V release I mentioned above, so
it's been missing for a long time.  We managed to locate a replacement
Seventh Edition page and soon discovered that it was incorrect and
incomplete.  The library itself contains a grand total of one (1)
comment, so we had to poke around a bit to come up with the proper
information...  If you're doing any work with the mp library (?!), you
might fare better by using the 4.3 BSD manual page than the Seventh
Edition one.

My one regret is failing to catch the '#ifdef lint' in 'mp.h',

Donn Seeley    University of Utah CS Dept    donn at cs.utah.edu
40 46' 6"N 111 50' 34"W    (801) 581-5668    utah-cs!donn



More information about the Comp.unix.questions mailing list