Class SqrtExact

java.lang.Object
de.tilman_neumann.jml.roots.SqrtExact

public class SqrtExact
extends java.lang.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.
  • Constructor Summary

    Constructors
    Constructor Description
    SqrtExact()  
  • Method Summary

    Modifier and Type Method Description
    static java.math.BigInteger exactSqrt​(java.math.BigInteger n)
    Return sqrt(n) if n is a square of an integer, null otherwise.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SqrtExact

      public SqrtExact()
  • Method Details

    • exactSqrt

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