0

I've never solved this type of problem before, so I'm not aware of the techniques used to solve it. Becuase in my particular scenario I ultimately need to print the result to the console, my guess is that I have to create some custom class that uses text to do multiplication operations. For instance, if I was dealing with an 8-bit machine and needed to compute 127^2 I would do long multiplication like you learn when you're a little kid:

  127
x 127
-------
  889
 254
127
-------
 2629

Am I on the right track here?

user6048670
  • 2,861
  • 4
  • 16
  • 20
  • 2
    You may want to look at [`BigInteger`](https://msdn.microsoft.com/en-us/library/system.numerics.biginteger(v=vs.110).aspx) – René Vogt Aug 08 '16 at 13:01
  • There is a slight difference between the dup and this one, and that is that the dup uses `ulong` opposed to `long`. `ulong` is the single option you have before using the answers on that question. – Patrick Hofman Aug 08 '16 at 13:06
  • You *can* still do your own long multiplication, if you want, or if you must target .NET 2.0 (do people still do that?). As a tip, don't do it text based, do it `uint` based (not `ulong` based, the partial products would overflow) so it does more useful math at once. – harold Aug 08 '16 at 13:31

0 Answers0