The GNU MP Library is free software; you can redistribute it and/or modify it under the terms of either:
* the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
or
* the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
or both in parallel, as here.
The GNU MP Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received copies of the GNU General Public License and the GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
/* Handle special cases that don't work in generic code below. */ if (usize == 0)
{
set_r_v_maybe: if (r != v)
mpf_set (r, v); return;
} if (vsize == 0)
{
v = u; goto set_r_v_maybe;
}
/* If signs of U and V are different, perform subtraction. */ if ((usize ^ vsize) < 0)
{
__mpf_struct v_negated;
v_negated._mp_size = -vsize;
v_negated._mp_exp = v->_mp_exp;
v_negated._mp_d = v->_mp_d;
mpf_sub (r, u, &v_negated); return;
}
TMP_MARK;
/* Signs are now known to be the same. */
negate = usize < 0;
/* Make U be the operand with the largest exponent. */ if (u->_mp_exp < v->_mp_exp)
{
mpf_srcptr t;
t = u; u = v; v = t;
usize = u->_mp_size;
vsize = v->_mp_size;
}
/* If U extends beyond PREC, ignore the part that does. */ if (usize > prec)
{
up += usize - prec;
usize = prec;
}
/* If V extends beyond PREC, ignore the part that does.
Note that this may make vsize negative. */ if (vsize + ediff > prec)
{
vp += vsize + ediff - prec;
vsize = prec - ediff;
}
#if 0 /* Locate the least significant non-zero limb in (the needed parts
of) U and V, to simplify the code below. */ while (up[0] == 0)
up++, usize--; while (vp[0] == 0)
vp++, vsize--; #endif
/* Allocate temp space for the result. Allocate
just vsize + ediff later??? */
tp = TMP_ALLOC_LIMBS (prec);
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 ist noch experimentell.