GMP Native Interface for .NET
gmp_libmpf_get_prec Method |
Return the current precision of op, in bits.
Namespace: Math.Gmp.Native
Assembly: Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)

public static mp_bitcnt_t mpf_get_prec( mpf_t op )
Public Shared Function mpf_get_prec ( op As mpf_t ) As mp_bitcnt_t
public: static mp_bitcnt_t mpf_get_prec( mpf_t^ op )
static member mpf_get_prec : op : mpf_t -> mp_bitcnt_t
Parameters
- op
- Type: Math.Gmp.Nativempf_t
The operand float.
Return Value
Type: mp_bitcnt_tThe current precision of op, in bits.

// Create and initialize a new floating-point number x with 64-bit precision. mpf_t x = new mpf_t(); gmp_lib.mpf_init2(x, 64U); // Assert that the value of x is 0.0, and that its precision is 64 bits. Assert.IsTrue(gmp_lib.mpf_get_d(x) == 0.0); Assert.IsTrue(gmp_lib.mpf_get_prec(x) == 64U); // Release unmanaged memory allocated for x. gmp_lib.mpf_clear(x);
' Create and initialize a new floating-point number x with 64-bit precision. Dim x As New mpf_t() gmp_lib.mpf_init2(x, 64UI) ' Assert that the value of x is 0.0, and that its precision is 64 bits. Assert.IsTrue(gmp_lib.mpf_get_d(x) = 0.0) Assert.IsTrue(gmp_lib.mpf_get_prec(x) = 64UI) ' Release unmanaged memory allocated for x. gmp_lib.mpf_clear(x)
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.
