YoushouldhavereceivedcopiesoftheGNUGeneralPublicLicenseandthe GNULesserGeneralPublicLicensealongwiththeGNUMPLibrary.Ifnot,
see https://www.gnu.org/licenses/. */
#include <stdio.h> /* for NULL */ #include"gmp-impl.h"
int
mpz_root (mpz_ptr root, mpz_srcptr u, unsignedlongint nth)
{
mp_ptr rootp, up;
mp_size_t us, un, rootn, remn;
TMP_DECL;
us = SIZ(u);
/* even roots of negatives provoke an exception */ if (UNLIKELY (us < 0 && (nth & 1) == 0))
SQRT_OF_NEGATIVE;
if (UNLIKELY (nth <= 1))
{ /* root extraction interpreted as c^(1/nth) means a zeroth root should
provoke a divide by zero, do this even if c==0 */ if (UNLIKELY (nth == 0))
DIVIDE_BY_ZERO; /* nth == 1 */ if (root != NULL && u != root)
mpz_set (root, u); return1; /* exact result */
}
if (us == 0)
{ if (root != NULL)
SIZ(root) = 0; return1; /* exact result */
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.