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_z(
mpq_t op1,
mpz_t op2
)
Public Shared Function mpq_cmp_z (
op1 As mpq_t,
op2 As mpz_t
) As Integer
public:
static int mpq_cmp_z(
mpq_t^ op1,
mpz_t^ op2
)
static member mpq_cmp_z :
op1 : mpq_t *
op2 : mpz_t -> int
Parameters
- op1
- Type: Math.Gmp.Nativempq_t
The first operand rational. - op2
- Type: Math.Gmp.Nativempz_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);
mpz_t op2 = new mpz_t();
gmp_lib.mpz_init(op2);
gmp_lib.mpz_set_si(op2, 3);
Assert.IsTrue(gmp_lib.mpq_cmp_z(op1, op2) < 0);
gmp_lib.mpq_clear(op1);
gmp_lib.mpz_clear(op2);
Dim op1 As New mpq_t()
gmp_lib.mpq_init(op1)
gmp_lib.mpq_set_si(op1, 1, 2UI)
Dim op2 As New mpz_t()
gmp_lib.mpz_init(op2)
gmp_lib.mpz_set_si(op2, 3)
Assert.IsTrue(gmp_lib.mpq_cmp_z(op1, op2) < 0)
gmp_lib.mpq_clear(op1)
gmp_lib.mpz_clear(op2)
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