Calculate square root of a BigInteger (System.Numerics.BigInteger)
Check if BigInteger is not a perfect square has code to compute the integer square root of a Java BigInteger. Here it is translated into C#, as an extension method. public static BigInteger Sqrt(this BigInteger n) { if (n == 0) return 0; if (n > 0) { int bitLength = Convert.ToInt32(Math.Ceiling(BigInteger.Log(n, 2))); BigInteger root … Read more