GMP Native Interface for .NET
gmp_libmpz_init_set_d Method |
Initialize rop with limb space and set the initial numeric value from op.
Namespace: Math.Gmp.Native
Assembly: Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)

public static void mpz_init_set_d( mpz_t rop, double op )
Public Shared Sub mpz_init_set_d ( rop As mpz_t, op As Double )
public: static void mpz_init_set_d( mpz_t^ rop, double op )
static member mpz_init_set_d : rop : mpz_t * op : float -> unit
Parameters
- rop
- Type: Math.Gmp.Nativempz_t
The destination integer. - op
- Type: SystemDouble
The source integer.

mpz_init_set_d truncate op to make it an integer.

// Create, initialize, and set the value of x to the truncation of 10.7. mpz_t x = new mpz_t(); gmp_lib.mpz_init_set_d(x, 10.7D); // Assert that the value of x is 10. Assert.IsTrue(gmp_lib.mpz_get_si(x) == 10); // Release unmanaged memory allocated for x. gmp_lib.mpz_clear(x);
' Create, initialize, and set the value of x to the truncation of 10.7. Dim x As New mpz_t() gmp_lib.mpz_init_set_d(x, 10.7) ' Assert that the value of x is 10. Assert.IsTrue(gmp_lib.mpz_get_si(x) = 10) ' Release unmanaged memory allocated for x. gmp_lib.mpz_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.
