gmp_libmpz_sqrt Method |
Namespace: Math.Gmp.Native
public static void mpz_sqrt( mpz_t rop, mpz_t op )
Public Shared Sub mpz_sqrt ( rop As mpz_t, op As mpz_t )
public: static void mpz_sqrt( mpz_t^ rop, mpz_t^ op )
static member mpz_sqrt : rop : mpz_t * op : mpz_t -> unit
// Create, initialize, and set the value of op to 10000. mpz_t op = new mpz_t(); gmp_lib.mpz_init_set_si(op, 10000); // Create, initialize, and set the value of rop to 0. mpz_t rop = new mpz_t(); gmp_lib.mpz_init(rop); // Set rop = trunc(sqrt(op)). gmp_lib.mpz_sqrt(rop, op); // Assert that rop is 100. Assert.IsTrue(gmp_lib.mpz_get_si(rop) == 100); // Release unmanaged memory allocated for rop and op. gmp_lib.mpz_clears(rop, op, null);
' Create, initialize, and set the value of op to 10000. Dim op As New mpz_t() gmp_lib.mpz_init_set_si(op, 10000) ' Create, initialize, and set the value of rop to 0. Dim rop As New mpz_t() gmp_lib.mpz_init(rop) ' Set rop = trunc(sqrt(op)). gmp_lib.mpz_sqrt(rop, op) ' Assert that rop is 100. Assert.IsTrue(gmp_lib.mpz_get_si(rop) = 100) ' Release unmanaged memory allocated for rop and op. gmp_lib.mpz_clears(rop, op, Nothing)
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.