gmp_libmpq_numref Method |
Namespace: Math.Gmp.Native
public static mpz_t mpq_numref( mpq_t op )
Public Shared Function mpq_numref ( op As mpq_t ) As mpz_t
public: static mpz_t^ mpq_numref( mpq_t^ op )
static member mpq_numref : op : mpq_t -> mpz_t
The mpz functions can be used on the returned reference.
// Create, initialize, and set the value of op to -1 / 3. mpq_t op = new mpq_t(); gmp_lib.mpq_init(op); gmp_lib.mpq_set_si(op, -1, 3U); // Get reference to numerator, and increment it by 2. mpz_t num = gmp_lib.mpq_numref(op); gmp_lib.mpz_add_ui(num, num, 2U); // Assert that op is 1 / 3. Assert.IsTrue(gmp_lib.mpq_cmp_si(op, 1, 3U) == 0); // Release unmanaged memory allocated for op. gmp_lib.mpq_clear(op);
' Create, initialize, and set the value of op to -1 / 3. Dim op As New mpq_t() gmp_lib.mpq_init(op) gmp_lib.mpq_set_si(op, -1, 3UI) ' Get reference to numerator, and increment it by 2. Dim num As mpz_t = gmp_lib.mpq_numref(op) gmp_lib.mpz_add_ui(num, num, 2UI) ' Assert that op is 1 / 3. Assert.IsTrue(gmp_lib.mpq_cmp_si(op, 1, 3UI) = 0) ' Release unmanaged memory allocated for op. gmp_lib.mpq_clear(op)
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.