// TestLipmaaDecompositionWithSmallIntegers iteratively tests whether the roots of retrieved
// decompositions sum up exactly to a given integer when they are squared.
TestLipmaaDecompositionWithSmallIntegers iteratively tests whether the roots of retrieved
decompositions sum up exactly to a given integer when they are squared.
// TestLipmaaDecompositionWithSmallIntegers iteratively tests whether the roots of retrieved // decompositions sum up exactly to a given integer when they are squared .
func TestLipmaaDecompositionWithSmallIntegers(t *testing.T) {
	var bigInt = new(big.Int)
	for i := 0; i <= 10000; i++ {
		bigInt.SetInt64(int64(i))
		roots, _ := lipmaaDecompose(bigInt)
		squaredRootsSum := squareRootsAndSum(roots)
		if bigInt.Cmp(squaredRootsSum) != 0 {
			t.Errorf("decomposition does not work correctly for small integers ("+
				"expected root to sum up to %d, got %d)", bigInt.Int64(), squaredRootsSum.Int64())
		}
	}
}
func TestLipmaaDecompositionWithSmallIntegers ( t * testing . T ) { var bigInt = new ( big . Int ) for i := 0 ; i <= 10000 ; i ++ { bigInt . SetInt64 ( int64 ( i ) ) roots , _ := lipmaaDecompose ( bigInt ) squaredRootsSum := squareRootsAndSum ( roots ) if bigInt . Cmp ( squaredRootsSum ) != 0 { t . Errorf ( " " + " " , bigInt . Int64 ( ) , squaredRootsSum . Int64 ( ) ) } } }
TestLipmaaDecompositionWithSmallIntegers iteratively tests whether the roots of retrieved
decompositions sum up exactly to a given integer when they are squared.
TestLipmaaDecompositionWithSmallIntegers iteratively tests whether the roots of retrieved decompositions sum up exactly to a given integer when they are squared .