gmp_lib.mpn_com Method

GMP Native Interface for .NET

gmp_libmpn_com Method
Perform the bitwise complement of {sp, n}, and write the result to {rp, n}.

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 void mpn_com(
	mp_ptr rp,
	mp_ptr sp,
	mp_size_t n
)
Public Shared Sub mpn_com ( 
	rp As mp_ptr,
	sp As mp_ptr,
	n As mp_size_t
)
public:
static void mpn_com(
	mp_ptr^ rp, 
	mp_ptr^ sp, 
	mp_size_t n
)
static member mpn_com : 
        rp : mp_ptr * 
        sp : mp_ptr * 
        n : mp_size_t -> unit 

Parameters

rp
Type: Math.Gmp.Nativemp_ptr
The result integer.
sp
Type: Math.Gmp.Nativemp_ptr
The operand integer.
n
Type: Math.Gmp.Nativemp_size_t
The numbe rof limbs of rp>> and sp.
Examples
// Create multi-precision operands, and expected result.
mp_ptr sp = new mp_ptr(new uint[] { 0xf0f0f0f0, 0xf0f0f0f0 });
mp_ptr rp = new mp_ptr(new uint[2]);
mp_ptr result = new mp_ptr(new uint[] { 0x0f0f0f0f, 0x0f0f0f0f });

// Set rp = not(sp).
gmp_lib.mpn_com(rp, sp, sp.Size);

// Assert result of operation.
Assert.IsTrue(rp.SequenceEqual(result));

// Release unmanaged memory.
gmp_lib.free(rp, sp, result);
' Create multi-precision operands, and expected result.
Dim sp As New mp_ptr(New UInteger() { &Hf0f0f0f0UI, &Hf0f0f0f0UI})
Dim rp As New mp_ptr(New UInteger(1) { })
Dim result As New mp_ptr(New UInteger() { &Hf0f0f0f, &Hf0f0f0f})

' Set rp = not(sp).
gmp_lib.mpn_com(rp, sp, sp.Size)

' Assert result of operation.
Assert.IsTrue(rp.SequenceEqual(result))

' Release unmanaged memory.
gmp_lib.free(rp, sp, result)

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