gmp_libmpq_denref Method |
Namespace: Math.Gmp.Native
public static mpz_t mpq_denref( mpq_t op )
Public Shared Function mpq_denref ( op As mpq_t ) As mpz_t
public: static mpz_t^ mpq_denref( mpq_t^ op )
static member mpq_denref : 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 denominator, and increment it by 2. mpz_t num = gmp_lib.mpq_denref(op); gmp_lib.mpz_add_ui(num, num, 2U); // Assert that op is -1 / 5. Assert.IsTrue(gmp_lib.mpq_cmp_si(op, -1, 5U) == 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 denominator, and increment it by 2. Dim num As mpz_t = gmp_lib.mpq_denref(op) gmp_lib.mpz_add_ui(num, num, 2UI) ' Assert that op is -1 / 5. Assert.IsTrue(gmp_lib.mpq_cmp_si(op, -1, 5UI) = 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.