Calculating the square of BigInteger

Posted by brickner on Stack Overflow See other posts from Stack Overflow or by brickner
Published on 2010-06-17T22:05:22Z Indexed on 2010/06/18 1:13 UTC
Read the original article Hit count: 534

Filed under:
|
|
|
|

Hi,

I'm using .NET 4's System.Numerics.BigInteger structure.

I need to calculate the square (x^2) of very large numbers.

If x is a BigInteger, What is the time complexity of:

x*x;

or

BigInteger.Pow(x,2);

?

If it's worse than O(n^2), do you have a better implementation? Maybe something like Schönhage–Strassen algorithm?

© Stack Overflow or respective owner

Related posts about c#

Related posts about math