Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request for a java program

 
sumanth royal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai Frnds, can You please Provide me a java Program to find the multiplication of two large numbers
 
Stephan van Hulst
Bartender
Pie
Posts: 5912
64
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's stopping you from doing it yourself?
 
sumanth royal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

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

Please try something yourself first. If you have a specific question about something, please ask it here. Show us your code and explain exactly what you did, and what your question is.
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 49442
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Brother
 
dennis deems
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a reason folks are recommending BigDecimal instead of BigInteger?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12147
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya.we have multiply two large integer numbers (say like 40).
 
Campbell Ritchie
Sheriff
Pie
Posts: 49442
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For integers, you would use BigInteger, which is similar to BigDecimal.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic