gmp_lib.mpn_perfect_square_p Method

GMP Native Interface for .NET

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
)
Public Shared Function mpn_perfect_square_p ( 
	s1p As mp_ptr,
	n As mp_size_t
) As Integer
public:
static int mpn_perfect_square_p(
	mp_ptr^ s1p, 
	mp_size_t n
)
static member mpn_perfect_square_p : 
        s1p : mp_ptr * 
        n : mp_size_t -> int 

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);
' Create multi-precision operand.
Dim s1p As New mp_ptr(New UInteger() { &HffffffffUI, &HffffffffUI})

' 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)

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also