Compare op1 and op2.
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(
mpq_t op1,
mpq_t op2
)
Public Shared Function mpq_cmp (
op1 As mpq_t,
op2 As mpq_t
) As Integer
public:
static int mpq_cmp(
mpq_t^ op1,
mpq_t^ op2
)
static member mpq_cmp :
op1 : mpq_t *
op2 : mpq_t -> int
Parameters
- op1
- Type: Math.Gmp.Nativempq_t
The first operand rational. - op2
- Type: Math.Gmp.Nativempq_t
The second operand rational.
Return Value
Type:
Int32Return a positive value if
op1 > op2, zero if
op1 = op2, and a negative value if
op1 < op2.
Remarks Examples
mpq_t op1 = new mpq_t();
gmp_lib.mpq_init(op1);
gmp_lib.mpq_set_si(op1, 1, 2U);
mpq_t op2 = new mpq_t();
gmp_lib.mpq_init(op2);
gmp_lib.mpq_set_si(op2, 1, 3U);
Assert.IsTrue(gmp_lib.mpq_cmp(op1, op2) > 0);
gmp_lib.mpq_clears(op1, op2, null);
Dim op1 As New mpq_t()
gmp_lib.mpq_init(op1)
gmp_lib.mpq_set_si(op1, 1, 2UI)
Dim op2 As New mpq_t()
gmp_lib.mpq_init(op2)
gmp_lib.mpq_set_si(op2, 1, 3UI)
Assert.IsTrue(gmp_lib.mpq_cmp(op1, op2) > 0)
gmp_lib.mpq_clears(op1, op2, Nothing)
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.
See Also