Click or drag to resize
gmp_libmpn_perfect_square_p Method
Return non-zero iff {s1p, n} is a perfect square.

Namespace:  Math.Gmp.Native
Assembly:  Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static int mpn_perfect_square_p(
	mp_ptr s1p,
	mp_size_t n
)

Parameters

s1p
Type: Math.Gmp.Nativemp_ptr
The operand integer.
n
Type: Math.Gmp.Nativemp_size_t
The numbe rof limbs of s1p.

Return Value

Type: Int32
Non-zero iff {s1p, n} is a perfect square.
Remarks

The most significant limb of the input {s1p, n} must be non-zero.

Examples
// Create multi-precision operand.
mp_ptr s1p = new mp_ptr(new uint[] { 0xffffffff, 0xffffffff });

// Assert s1p is not a perfect square.
Assert.IsTrue(gmp_lib.mpn_perfect_square_p(s1p, s1p.Size) == 0);

// Release unmanaged memory.
gmp_lib.free(s1p);
See Also