home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!ftpbox!motsrd!mothost!merlin.dev.cdx.mot.com!merlin.dev.cdx.mot.com!lezz
- From: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
- Subject: Re: POWER OF LARGE NUMBERS
- Message-ID: <1992Aug17.222948.10070@merlin.dev.cdx.mot.com>
- Sender: news@merlin.dev.cdx.mot.com (USENET News System)
- Nntp-Posting-Host: monarch.dev.cdx.mot.com
- Reply-To: lezz@merlin.dev.cdx.mot.com (Lezz Giles)
- Organization: Motorola Codex, Canton, MA
- References: <1992Aug12.135106.12924@cs.uow.edu.au> <thompson.713734408@daphne.socsci.umn.edu> <1992Aug16.052157.1991@organpipe.uug.arizona.edu>
- Date: Mon, 17 Aug 1992 22:29:48 GMT
- Lines: 49
-
- 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.
- |>
- |>Yah.
- |>
- |>>Is there any hope of solving this?
- |>
- |>Only if you're willing to give up most of the significant digits.
- |>But it's certainly within the bounds of imagination to have a
- |>program that could do something like
- |>
- |> google_t a, b ;
- |>
- |> a = make_google( 10, make_int(100) ) ;
- |> b = google_mult( a, a ) ;
- |>
- |>At this point, the value of `b' could be expressed as
- |>
- |> make_google( 10, make_google( 10, make_int(10) ) ) ;
- |>
- |>Of course, using C++ would make certain aspects of this easier...
-
- 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, but it wasn't
- too hard to write - I did it with each bunch of 3 digits held in an int
- as part of a linked list - if I overflowed I simply added a new element
- to the list. The answer had around 40,000 digits in it, i.e. was close to
- 100^2 - if you want to calculate a 100-digit number raised to the power
- of another 100-digit number, my guess is that you'll either run out of
- space in the universe to store the answer, or you'll run out of time
- before the universe ends.
-
- Lezz "no steady-state cosmology here" Giles
-