File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes I would like  to optmise multiplication ,please help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "I would like  to optmise multiplication ,please help" Watch "I would like  to optmise multiplication ,please help" New topic
Author

I would like to optmise multiplication ,please help

krishna kumar.s
Greenhorn

Joined: Oct 01, 2011
Posts: 19
To solve one of the puzzles I need to find the multiplication of a number which yields <2 .I used below code which takes 8hrs adn does go upto 10000, can anybody suggest a better efficient method for multiplication?
Ulf Dittmer
Rancher

Joined: Mar 22, 2005
Posts: 42954
    
  73
I'm not sure what the algorithm is supposed to do, but you're much better off handling large integers by using the java.math.BigInteger class than by using strings.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: I would like to optmise multiplication ,please help