gmp_libmpn_hamdist Method |
Namespace: Math.Gmp.Native
public static mp_bitcnt_t mpn_hamdist( mp_ptr s1p, mp_ptr s2p, mp_size_t n )
Public Shared Function mpn_hamdist ( s1p As mp_ptr, s2p As mp_ptr, n As mp_size_t ) As mp_bitcnt_t
public: static mp_bitcnt_t mpn_hamdist( mp_ptr^ s1p, mp_ptr^ s2p, mp_size_t n )
static member mpn_hamdist : s1p : mp_ptr * s2p : mp_ptr * n : mp_size_t -> mp_bitcnt_t
// Create multi-precision operands. mp_ptr s1p = new mp_ptr(new uint[] { 0xffffffff, 0xffffffff }); mp_ptr s2p = new mp_ptr(new uint[] { 0x00000001, 0xffffffff }); // Assert hamming distance. Assert.IsTrue(gmp_lib.mpn_hamdist(s1p, s2p, s1p.Size) == 31); // Release unmanaged memory. gmp_lib.free(s1p, s2p);
' Create multi-precision operands. Dim s1p As New mp_ptr(New UInteger() { &HffffffffUI, &HffffffffUI}) Dim s2p As New mp_ptr(New UInteger() { &H1, &HffffffffUI}) ' Assert hamming distance. Assert.IsTrue(gmp_lib.mpn_hamdist(s1p, s2p, s1p.Size) = 31) ' Release unmanaged memory. gmp_lib.free(s1p, s2p)
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.