gmp_libmpz_rootrem Method |
Set root to the truncated integer part of the nth root of u. Set rem to the remainder, u - root^n.
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 void mpz_rootrem(
mpz_t root,
mpz_t rem,
mpz_t u,
uint n
)
Public Shared Sub mpz_rootrem (
root As mpz_t,
rem As mpz_t,
u As mpz_t,
n As UInteger
)
public:
static void mpz_rootrem(
mpz_t^ root,
mpz_t^ rem,
mpz_t^ u,
unsigned int n
)
static member mpz_rootrem :
root : mpz_t *
rem : mpz_t *
u : mpz_t *
n : uint32 -> unit
Parameters
- root
- Type: Math.Gmp.Nativempz_t
The result root integer. - rem
- Type: Math.Gmp.Nativempz_t
The result remainder integer. - u
- Type: Math.Gmp.Nativempz_t
The first operand integer. - n
- Type: SystemUInt32
The second operand integer.
Examples
mpz_t u = new mpz_t();
gmp_lib.mpz_init_set_si(u, 10000);
mpz_t root = new mpz_t();
mpz_t rem = new mpz_t();
gmp_lib.mpz_inits(root, rem, null);
gmp_lib.mpz_rootrem(root, rem, u, 3U);
Assert.IsTrue(gmp_lib.mpz_get_si(root) == 21);
Assert.IsTrue(gmp_lib.mpz_get_si(rem) == 739);
gmp_lib.mpz_clears(root, rem, u, null);
Dim u As New mpz_t()
gmp_lib.mpz_init_set_si(u, 10000)
Dim root As New mpz_t()
Dim[rem] As New mpz_t()
gmp_lib.mpz_inits(root, [rem], Nothing)
gmp_lib.mpz_rootrem(root, [rem], u, 3UI)
Assert.IsTrue(gmp_lib.mpz_get_si(root) = 21)
Assert.IsTrue(gmp_lib.mpz_get_si([rem]) = 739)
gmp_lib.mpz_clears(root, [rem], u, 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.
See Also