Click or drag to resize
gmp_libmpq_cmp_si Method
Compare op1 and num2 / den2.

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 int mpq_cmp_si(
	mpq_t op1,
	int num2,
	uint den2
)

Parameters

op1
Type: Math.Gmp.Nativempq_t
The first operand rational.
num2
Type: SystemInt32
The second operand numerator integer.
den2
Type: SystemUInt32
The second operand denominator integer.

Return Value

Type: Int32
Return a positive value if op1 > num2 / den2, zero if op1 = num2 / den2, and a negative value if op1 < num2 / den2.
Remarks

num2 and den2 are allowed to have common factors.

Examples
// Create, initialize, and set the value of op1 to 1 / 2.
mpq_t op1 = new mpq_t();
gmp_lib.mpq_init(op1);
gmp_lib.mpq_set_si(op1, 1, 2U);

// Assert that op1 < 5/6.
Assert.IsTrue(gmp_lib.mpq_cmp_si(op1, 5, 6U) < 0);

// Release unmanaged memory allocated for op1.
gmp_lib.mpq_clear(op1);
See Also