gmp_libmpz_get_si Method |
Namespace: Math.Gmp.Native
public static int mpz_get_si( mpz_t op )
Public Shared Function mpz_get_si ( op As mpz_t ) As Integer
public: static int mpz_get_si( mpz_t^ op )
static member mpz_get_si : op : mpz_t -> int
If op fits into a signed long int return the value of op. Otherwise return the least significant part of op, with the same sign as op.
If op is too big to fit in a signed long int, the returned result is probably not very useful. To find out if the value will fit, use the function mpz_fits_slong_p.
// Create, initialize, and set the value of x to -10. mpz_t x = new mpz_t(); gmp_lib.mpz_init_set_si(x, -10); // Retrieve the value of x, and assert that it 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 -10. Dim x As New mpz_t() gmp_lib.mpz_init_set_si(x, -10) ' Retrieve the value of x, and assert that it 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.