gmp_libmpq_get_d Method |
Namespace: Math.Gmp.Native
public static double mpq_get_d( mpq_t op )
Public Shared Function mpq_get_d ( op As mpq_t ) As Double
public: static double mpq_get_d( mpq_t^ op )
static member mpq_get_d : op : mpq_t -> float
If the exponent from the conversion is too big or too small to fit a double then the result is system dependent. For too big an infinity is returned when available. For too small 0.0 is normally returned. Hardware overflow, underflow and denorm traps may or may not occur.
// Create, initialize, and set the value of x to 10 / 11. mpq_t x = new mpq_t(); gmp_lib.mpq_init(x); gmp_lib.mpq_set_si(x, 10, 11U); // Assert that the value of x is 10.0. Assert.IsTrue(gmp_lib.mpq_get_d(x) == 10.0 / 11.0); // Release unmanaged memory allocated for x. gmp_lib.mpq_clear(x);
' Create, initialize, and set the value of x to 10 / 11. Dim x As New mpq_t() gmp_lib.mpq_init(x) gmp_lib.mpq_set_si(x, 10, 11UI) ' Assert that the value of x is 10.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.