gmp_libmpq_set_ui Method |
Namespace: Math.Gmp.Native
public static void mpq_set_ui( mpq_t rop, uint op1, uint op2 )
Public Shared Sub mpq_set_ui ( rop As mpq_t, op1 As UInteger, op2 As UInteger )
public: static void mpq_set_ui( mpq_t^ rop, unsigned int op1, unsigned int op2 )
static member mpq_set_ui : rop : mpq_t * op1 : uint32 * op2 : uint32 -> unit
Note that if op1 and op2 have common factors, rop has to be passed to mpq_canonicalize before any operations are performed on rop.
// Create and initialize a new rational x. mpq_t x = new mpq_t(); gmp_lib.mpq_init(x); // Set the value of x to 10 / 11. gmp_lib.mpq_set_ui(x, 10U, 11U); // Assert that the value of x is 10 / 11. Assert.IsTrue(gmp_lib.mpq_cmp_ui(x, 10U, 11U) == 0); // Release unmanaged memory allocated for x. gmp_lib.mpq_clear(x);
' Create and initialize a new rational x. Dim x As New mpq_t() gmp_lib.mpq_init(x) ' Set the value of x to 10 / 11. gmp_lib.mpq_set_ui(x, 10UI, 11UI) ' Assert that the value of x is 10 / 11. Assert.IsTrue(gmp_lib.mpq_cmp_ui(x, 10UI, 11UI) = 0) ' Release unmanaged memory allocated for x. gmp_lib.mpq_clear(x)
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.