Click or drag to resize
gmp_libmpz_odd_p Method
Determine whether op is odd.

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

Parameters

op
Type: Math.Gmp.Nativempz_t
The operand integer.

Return Value

Type: Int32
Return non-zero if odd, zero if even.
Examples
// Create, initialize, and set the value of op to 427294.
mpz_t op = new mpz_t();
gmp_lib.mpz_init_set_ui(op, 427294);

// Assert that op is not odd but even.
Assert.IsTrue(gmp_lib.mpz_even_p(op) > 0);
Assert.IsTrue(gmp_lib.mpz_odd_p(op) == 0);

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