gmp_libmpq_set_d Method |
Namespace: Math.Gmp.Native
public static void mpq_set_d( mpq_t rop, double op )
Public Shared Sub mpq_set_d ( rop As mpq_t, op As Double )
public: static void mpq_set_d( mpq_t^ rop, double op )
static member mpq_set_d : rop : mpq_t * op : float -> unit
// Create and initialize a new rational. mpq_t x = new mpq_t(); gmp_lib.mpq_init(x); // Set the value of x to 10.0 / 11.0. gmp_lib.mpq_set_d(x, 10.0D / 11.0); // Assert that the value of x is 10.0 / 11.0. Assert.IsTrue(gmp_lib.mpq_get_d(x) == 10.0D / 11.0); // Release unmanaged memory allocated for x. gmp_lib.mpq_clear(x);
' Create and initialize a new rational. Dim x As New mpq_t() gmp_lib.mpq_init(x) ' Set the value of x to 10.0 / 11.0. gmp_lib.mpq_set_d(x, 10.0 / 11.0) ' Assert that the value of x is 10.0 / 11.0. Assert.IsTrue(gmp_lib.mpq_get_d(x) = 10.0 / 11.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.