GMP Native Interface for .NET
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)

public static int mpz_odd_p( mpz_t op )
Public Shared Function mpz_odd_p ( op As mpz_t ) As Integer
public: static int mpz_odd_p( mpz_t^ op )
static member mpz_odd_p : op : mpz_t -> int
Parameters
- op
- Type: Math.Gmp.Nativempz_t
The operand integer.
Return Value
Type: Int32Return non-zero if odd, zero if even.

// 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);
' Create, initialize, and set the value of op to 427294. Dim op As 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)
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.
