summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>1999-06-21 11:27:29 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>1999-06-21 11:27:29 +0000
commitdd582055695352608f681ed08d8c1717a1a2f6e2 (patch)
treee183cfc418d2b9751bc10077d47c1ceeb4c46bbc /tests
parent6d76ceb0928daf24dfa2f8f6c1cd1474e9e70eff (diff)
downloadmpfr-dd582055695352608f681ed08d8c1717a1a2f6e2.tar.gz
added one test
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@112 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests')
-rw-r--r--tests/tmul_ui.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/tmul_ui.c b/tests/tmul_ui.c
index e173f4e87..b17a8063a 100644
--- a/tests/tmul_ui.c
+++ b/tests/tmul_ui.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "gmp.h"
+#include "gmp-impl.h"
#include "mpfr.h"
#include "time.h"
@@ -10,6 +11,15 @@ main(int argc, char **argv)
mpfr_t x;
mpfr_init2(x, 53);
+
+ /* checks that result is normalized */
+ mpfr_set_d(x, 6.93147180559945286227e-01, GMP_RNDZ);
+ mpfr_mul_ui(x, x, 1, GMP_RNDZ);
+ if (MANT(x)[PREC(x)/BITS_PER_MP_LIMB] >> (BITS_PER_MP_LIMB-1) == 0) {
+ fprintf(stderr, "Error in mpfr_mul_ui: result not normalized\n");
+ exit(1);
+ }
+
mpfr_set_d(x, 1.0/3.0, GMP_RNDZ);
mpfr_print_raw(x); putchar('\n');