Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!

# Request for a java program

sumanth royal
Greenhorn
Posts: 4
Hai Frnds, can You please Provide me a java Program to find the multiplication of two large numbers

Stephan van Hulst
Bartender
Posts: 5790
61
• 1
What's stopping you from doing it yourself?

sumanth royal
Greenhorn
Posts: 4
Sir, I am Basic at Programming and Recently i started developing Programming Skills. I Had tried for it but i did not get it exactly. I would like to multiply the numbers of length more than 10. Please Help Me.

Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15272
37
Welcome to the Ranch.

Have a look at class BigDecimal (<= click that for the documentation).

Kemal Sokolovic
Bartender
Posts: 825
5
The forum is NotACodeMill, so you'll have to come up with something on your own and then come back so we can resolve any doubts you may have.

Campbell Ritchie
Sheriff
Posts: 48917
58
Jesper de Jong wrote:Welcome to the Ranch.
Agree

Have a look at class BigDecimal . . .
If you search this website for “BigDecimal multiply”, you should find something useful in a few minutes.

sumanth royal
Greenhorn
Posts: 4
Thanks Brother

dennis deems
Ranch Hand
Posts: 808
Is there a reason folks are recommending BigDecimal instead of BigInteger?

fred rosenberger
lowercase baba
Bartender
Posts: 12122
30
Dennis Deems wrote:Is there a reason folks are recommending BigDecimal instead of BigInteger?

The OP has only specified "large numbers" and "numbers of length more than 10". There is no clear (at least to me) specification as to whether they are integers or floating-point numbers.

sumanth royal
Greenhorn
Posts: 4
Ya.we have multiply two large integer numbers (say like 40).

Campbell Ritchie
Sheriff
Posts: 48917
58
For integers, you would use BigInteger, which is similar to BigDecimal.