Package de.tilman_neumann.jml.roots
Class SqrtExact
- java.lang.Object
-
- de.tilman_neumann.jml.roots.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 Summary
Constructors Constructor Description SqrtExact()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BigInteger
exactSqrt(BigInteger n)
Return sqrt(n) if n is a square of an integer, null otherwise.
-
-
-
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
-
-