gmp_libmpf_inits Method |
Namespace: Math.Gmp.Native
The precision of the initialized variables is undefined unless a default precision has already been established by a call to mpf_set_default_prec.
// Create new floating-point numbers x1, x2 and x3. mpf_t x1 = new mpf_t(); mpf_t x2 = new mpf_t(); mpf_t x3 = new mpf_t(); // Initialize the floating-point numbers. gmp_lib.mpf_inits(x1, x2, x3, null); // Assert that their value is 0. Assert.IsTrue(gmp_lib.mpf_get_d(x1) == 0.0); Assert.IsTrue(gmp_lib.mpf_get_d(x2) == 0.0); Assert.IsTrue(gmp_lib.mpf_get_d(x3) == 0.0); // Release unmanaged memory allocated for the floating-point numbers. gmp_lib.mpf_clears(x1, x2, x3, null);