Click or drag to resize
gmp_libmpq_denref Method
Return a reference to the denominator op.

Namespace:  Math.Gmp.Native
Assembly:  Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public static mpz_t mpq_denref(
	mpq_t op
)

Parameters

op
Type: Math.Gmp.Nativempq_t
The operand rational.

Return Value

Type: mpz_t
Return a reference to the denominator op.
Remarks

The mpz functions can be used on the returned reference.

Examples
// 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);
See Also