问题遇到的现象和发生背景
mpz_kronecker函数的返回值以及此函数作用不太了解
在查询了各大网站之后发现没有很清晰的解释
用代码块功能插入代码,请勿粘贴截图
运行结果及报错内容
z = mpz_kronecker(a,b);
当z的值为1,0,-1时,分别处于那些情况
我的解答思路和尝试过的方法
GMP官网给出来的解释为The Jacobi symbol (a/b) with the Kronecker extension (a/2) = (2/a) when a odd, or (a/2) = 0 when a even.
// Create, initialize, and set the value of a to 15.
mpz_t a = new mpz_t();
gmp_lib.mpz_init_set_ui(a, 15U);
// Create, initialize, and set the value of b to 4.
mpz_t b = new mpz_t();
gmp_lib.mpz_init_set_ui(b, 4U);
// Assert that the Kronecker symbol of (a/b) is 1.
Assert.IsTrue(gmp_lib.mpz_kronecker(a, b) == 1);
// Release unmanaged memory allocated for a and b.
gmp_lib.mpz_clears(a, b, null);
我想要达到的结果
想要了解一下具体的算法实现以及判断条件的事例