gmp_libmpq_cmp_ui Method |
Namespace: Math.Gmp.Native
public static int mpq_cmp_ui( mpq_t op1, uint num2, uint den2 )
Public Shared Function mpq_cmp_ui ( op1 As mpq_t, num2 As UInteger, den2 As UInteger ) As Integer
public: static int mpq_cmp_ui( mpq_t^ op1, unsigned int num2, unsigned int den2 )
static member mpq_cmp_ui : op1 : mpq_t * num2 : uint32 * den2 : uint32 -> int
num2 and den2 are allowed to have common factors.
// 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 == 3/6. Assert.IsTrue(gmp_lib.mpq_cmp_ui(op1, 3, 6U) == 0); // Release unmanaged memory allocated for op1. gmp_lib.mpq_clear(op1);
' Create, initialize, and set the value of op1 to 1 / 2. Dim op1 As New mpq_t() gmp_lib.mpq_init(op1) gmp_lib.mpq_set_si(op1, 1, 2UI) ' Assert that op1 == 3/6. Assert.IsTrue(gmp_lib.mpq_cmp_ui(op1, 3, 6UI) = 0) ' Release unmanaged memory allocated for op1. gmp_lib.mpq_clear(op1)
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.