long integer multiplication

H

helPlease

By long integer i mean very large number(say of 20 digits).If i store
it in a character array then what mechanism shud i follow to multiply
two such numbers.Could Booth's algo. be applied.Or if anybody has any
suggestions then please tell.
 
R

Richard Heathfield

helPlease said:
By long integer i mean very large number(say of 20 digits).If i store
it in a character array then what mechanism shud i follow to multiply
two such numbers.Could Booth's algo. be applied.Or if anybody has any
suggestions then please tell.

See "The Art of Computer Programming", Volume 2 ("Seminumerical
Algorithms"), by Donald E Knuth, section 4.3.
 
C

Chris Dollin

helPlease said:
By long integer i mean very large number(say of 20 digits).

20 decimal digits doesn't express a "very large" number; it's not even
enough for the number of protons in the observable universe.
 
R

Richard Heathfield

Chris Dollin said:
20 decimal digits doesn't express a "very large" number; it's not even
enough for the number of protons in the observable universe.

Yes, it is. You only need four. According to Schneier (not a fabulous
reference, I know, but convenient), there are 2 to the 265 atoms in the
galaxy. Assuming no more than 128 protons per atom on average (surely a
reasonable assumption!), that makes 2 to the 272 protons. Four digits
all told.
 
C

Chris Dollin

Richard said:
Chris Dollin said:


Yes, it is. You only need four.

I believe the OPs request has implicitly framed the digits as being
composed in the traditional fashion, in which four digits will get
you more more than 9999.

But then, you knew that, you rascal.
 
C

Chris Dollin

Chris said:
I believe the OPs request has implicitly framed the digits as being
composed in the traditional fashion, in which four digits will get
you more more than 9999.

(fx:growl)

s/more more/no more/.

--
"It took a very long time, much longer than the most /Sector General/
generous estimates." - James White

Hewlett-Packard Limited registered office: Cain Road, Bracknell,
registered no: 690597 England Berks RG12 1HN
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top