home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!cs.uoregon.edu!nntpserver!cgay
- From: cgay@majestix.cs.uoregon.edu (Carl L. Gay)
- Newsgroups: comp.lang.c
- Subject: Re: POWER OF LARGE NUMBERS
- Message-ID: <CGAY.92Aug17223208@majestix.cs.uoregon.edu>
- Date: 18 Aug 92 06:32:08 GMT
- References: <1992Aug12.135106.12924@cs.uow.edu.au>
- <thompson.713734408@daphne.socsci.umn.edu>
- <1992Aug16.052157.1991@organpipe.uug.arizona.edu>
- <1992Aug17.222948.10070@merlin.dev.cdx.mot.com>
- Sender: news@cs.uoregon.edu (Netnews Owner)
- Reply-To: cgay@cs.uoregon.edu
- Organization: CS Dept, University of Oregon
- Lines: 44
- In-Reply-To: lezz@merlin.dev.cdx.mot.com's message of Mon, 17 Aug 1992 22:29:48 GMT
-
-
- From: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
- Date: Mon, 17 Aug 1992 22:29:48 GMT
-
- In article <1992Aug16.052157.1991@organpipe.uug.arizona.edu>, dave@cs.arizona.edu (Dave Schaumann) writes:
- |>>
- |>>> Does any one know how to raise power of possibly 100 digits
- |>>>to possibly 100 digits. Any algorithm or code will be appriciated.
- |>>
- |>>>Example >(1234367463746464647464...up to 100 digit)**(647254627463048736...up to 100 digit)
- |>>
- |>>The order of magnitude of the solution to this problem is
- |>>
- |>> 10**(10**102)
- |>>
- |>>which is a ridiculously large number.
- |>>Is there any hope of solving this?
- |>
-
- It seems that an accurate answer might take rather a long time...
-
- On a connected note, I once wrote a program to calculate 6^6^6. My
- first attempt actually calculated (6^6)^6 and ran fairly quickly; my
- second attempt calculated 6^(6^6) and ran overnight on a VAX 11/780.
- It did it by taking 6^6 as a constant and used variable length arithmetic
- to multiply a variable-length number repeatedly by 6 that number of times.
- The variable length arithmetic may not have been optimal,
-
- Um, it almost certainly wasn't. On a Mac IIsi, in Lisp (sorry, I
- don't want to write it in C):
-
- ? (time (expt (expt 6 6) 6))
- (EXPT (EXPT 6 6) 6) took 34 milliseconds (0.034 seconds) to run.
- 56 bytes of memory allocated.
- 10314424798490535546171949056
- ? (time (expt 6 (expt 6 6)))
- (EXPT 6 (EXPT 6 6)) took 32290 milliseconds (32.290 seconds) to run.
- Of that, 120 milliseconds (0.120 seconds) were spent in The Cooperative Multitasking Experience.
- 30464 bytes of memory allocated.
- 265...36300 digits removed...656
-
- Just provided for your amusement...
-
- -Carl
-