gmp_libmpn_sizeinbase Method |
Namespace: Math.Gmp.Native
public static size_t mpn_sizeinbase( mp_ptr xp, mp_size_t n, int base )
Public Shared Function mpn_sizeinbase ( xp As mp_ptr, n As mp_size_t, base As Integer ) As size_t
public: static size_t mpn_sizeinbase( mp_ptr^ xp, mp_size_t n, int base )
static member mpn_sizeinbase : xp : mp_ptr * n : mp_size_t * base : int -> size_t
base can vary from 2 to 62. Requires n > 0 and xp[n - 1] > 0. The result will be either exact or 1 too big. If base is a power of 2, the result is always exact.
// Create multi-precision operands, and expected result. mp_ptr xp = new mp_ptr(new uint[] { 0x00000001, 0x00000001 }); // Assert that the number of bits required is 33. Assert.IsTrue(gmp_lib.mpn_sizeinbase(xp, xp.Size, 2) == 33); // Release unmanaged memory. gmp_lib.free(xp);
' Create multi-precision operands, and expected result. Dim xp As New mp_ptr(New UInteger() { &H1, &H1}) ' Assert that the number of bits required is 33. Assert.IsTrue(gmp_lib.mpn_sizeinbase(xp, xp.Size, 2) = 33) ' Release unmanaged memory. gmp_lib.free(xp)
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.