Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 324
  • Last Modified:

Tring to write a Multiplication method without using Biginteger.

I am trying to write a code that has multiplication method(n.multiply(n1) by using the linked array , stack or any other ways except using Biginteger. I don't know what to do.

ex)
   private static void test1 ( String s, String s2 )
   {
      ip n = new ip(s);
      ip n2 = n.multiply(n);
      System.out.println("\nTesting " + s + "\n" + ( n2.toString().equals(s2) ? "pass"  : "FAIL " ));
   }
0
jiwonman
Asked:
jiwonman
  • 4
  • 3
1 Solution
 
CEHJCommented:
To achieve something like in your example, all that's required is a type 'ip' with a multiply(ip) method
0
 
jiwonmanAuthor Commented:
>To achieve something like in your example, all that's required is a type 'ip' with a multiply(ip) method

I wanrt to know the concept by using the linked list or any other various ways to write the code.
0
 
CEHJCommented:
Not quite sure how a linked list would help you multiply. What is your assignment spec?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jiwonmanAuthor Commented:
Not quite sure how a linked list would help you multiply. What is your assignment spec?

I can choose different ways to do it other than linked list.
I am trying to write a code for a class IPint(Infinite Precision Integer) which will represent integers with any number of digits.
I will be testing it with the test that was posted on my thread.
0
 
CEHJCommented:
Oh OK. Yes - a linked list would help then. You can use LinkedList or ArrayList
0
 
jiwonmanAuthor Commented:
>Oh OK. Yes - a linked list would help then. You can use LinkedList or ArrayList

I see..
0
 
jiwonmanAuthor Commented:
>Oh OK. Yes - a linked list would help then. You can use LinkedList or ArrayList

I wanna know the concept of it. Also, where can I find the code for Biginteger in java compiler folder? I would like to study with it.
0
 
n_sachin1Commented:
If you have the jdk installed, look for src.zip in the root installation folder. This contains most of the public api classes (including java.math.BigInteger)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now