Private Function SqrtN(ByVal N As BigInteger) As BigInteger If (0 = N) Then Return 0 Dim n1 As BigInteger = (N >> 1) + 1 Dim n2 As BigInteger = (n1 + (N / n1)) >> 1 While (n2 < n1) n1 = n2 n2 = (n1 + (N / n1)) >> 1 End While Return n1 End Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)