Class SqrtExact


  • public class SqrtExact
    extends Object
    Fast recognition of exact integer squares, using the algorithm explained in class SqrtExactTest. Actually this is a copy of class SqrtExact03_12_v02, based on dataset 3 and using the square bit pattern test proposed by Graeme Willoughby, instead of a fastMod test. This is the fastest version so far.
    Author:
    Tilman Neumann
    • Constructor Detail

      • SqrtExact

        public SqrtExact()
    • Method Detail

      • exactSqrt

        public static BigInteger exactSqrt​(BigInteger n)
        Return sqrt(n) if n is a square of an integer, null otherwise.
        Parameters:
        n -
        Returns:
        sqrt(n) or null