Copyright 2012, 2013, 2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library test suite.
The GNU MP Library test suite is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
The GNU MP Library test suite 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 a copy of the GNU General Public License along with
the GNU MP Library test suite. If not, see https://www.gnu.org/licenses/. */
for (i = 0; i < COUNT; i++)
{ /* Use volatile, to avoid extended precision in floating point
registers, e.g., on m68k and 80387. */ volatiledouble d, f; unsignedlong m; int e;
mini_rrandomb (x, GMP_LIMB_BITS);
m = mpz_get_ui (x);
mini_urandomb (x, 8);
e = mpz_get_ui (x) - 100;
d = ldexp ((double) m, e);
mpz_set_d (x, d);
f = mpz_get_d (x); if (f != floor (d))
{
fprintf (stderr, "mpz_set_d/mpz_get_d failed:\n"); goto dumperror;
} if ((f == d) ? (mpz_cmp_d (x, d) != 0) : (mpz_cmp_d (x, d) >= 0))
{
fprintf (stderr, "mpz_cmp_d (x, d) failed:\n"); goto dumperror;
}
f = d + 1.0; if (f > d && ! (mpz_cmp_d (x, f) < 0))
{
fprintf (stderr, "mpz_cmp_d (x, f) failed:\n"); goto dumperror;
}
d = - d;
mpz_set_d (x, d);
f = mpz_get_d (x); if (f != ceil (d))
{
fprintf (stderr, "mpz_set_d/mpz_get_d failed:\n");
dumperror:
dump ("x", x);
fprintf (stderr, "m = %lx, e = %i\n", m, e);
fprintf (stderr, "d = %.15g\n", d);
fprintf (stderr, "f = %.15g\n", f);
fprintf (stderr, "f - d = %.5g\n", f - d);
abort ();
} if ((f == d) ? (mpz_cmp_d (x, d) != 0) : (mpz_cmp_d (x, d) <= 0))
{
fprintf (stderr, "mpz_cmp_d (x, d) failed:\n"); goto dumperror;
}
f = d - 1.0; if (f < d && ! (mpz_cmp_d (x, f) > 0))
{
fprintf (stderr, "mpz_cmp_d (x, f) failed:\n"); goto dumperror;
}
}
mpz_clear (x);
test_matissa();
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
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.