Click or drag to resize
gmp_libmpz_get_si Method
Return the value of op as an signed long.

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 int mpz_get_si(
	mpz_t op
)

Parameters

op
Type: Math.Gmp.Nativempz_t
The integer.

Return Value

Type: Int32
The value of op as an signed long.
Remarks

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.

Examples
// 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);
See Also