diff options
author | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 1999-06-25 09:28:43 +0000 |
---|---|---|
committer | hanrot <hanrot@280ebfd0-de03-0410-8827-d642c229c3f4> | 1999-06-25 09:28:43 +0000 |
commit | 1f38fc57a004362e0249cd0a6c51b02aaad63f4e (patch) | |
tree | e6669decf6aeec71f56eb666e080f744d3cc9b0f /tests/tcan_round.c | |
parent | 0f385cb8314dca738841506c8b0cede45309d6d7 (diff) | |
download | mpfr-1f38fc57a004362e0249cd0a6c51b02aaad63f4e.tar.gz |
Initial revision.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@166 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tcan_round.c')
-rw-r--r-- | tests/tcan_round.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/tcan_round.c b/tests/tcan_round.c new file mode 100644 index 000000000..9d8889e43 --- /dev/null +++ b/tests/tcan_round.c @@ -0,0 +1,17 @@ +#include <stdio.h> +#include <stdlib.h> +#include "gmp.h" +#include "mpfr.h" + +main() +{ + mpfr_t x; + + /* checks that rounds to nearest sets the last + bit to zero in case of equal distance */ + mpfr_init2(x, 59); + mpfr_set_str_raw(x, "-0.10010001010111000011110010111010111110000000111101100111111E663"); + mpfr_print_raw(x); + + printf("mpfr_can_round(x, 54, Z, Z, 53) = %d\n", mpfr_can_round(x, 54, GMP_RNDZ, GMP_RNDZ, 53)); +} |