Click or drag to resize
gmp_libmpz_get_d Method
Convert op to a double, truncating if necessary (i.e. rounding towards zero).

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 double mpz_get_d(
	mpz_t op
)

Parameters

op
Type: Math.Gmp.Nativempz_t
The integer.

Return Value

Type: Double
op as a double, truncating it if necessary (i.e. rounding towards zero).
Remarks

If the exponent from the conversion is too big, the result is system dependent. An infinity is returned where available. A hardware overflow trap may or may not occur.

Examples
// Create, initialize, and set the value of x to 10.
mpz_t x = new mpz_t();
gmp_lib.mpz_init_set_d(x, 10.7D);

// Assert that the value of x is 10.0.
Assert.IsTrue(gmp_lib.mpz_get_d(x) == 10.0);

// Release unmanaged memory allocated for x.
gmp_lib.mpz_clear(x);
See Also