summaryrefslogtreecommitdiff
path: root/tests/tget_set_d64.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2006-11-08 07:47:07 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2006-11-08 07:47:07 +0000
commit5e228aa6f9e5e4879163b8fc90738309f900239b (patch)
tree56e17ba569418d56970bd17403e78d8bda6b0777 /tests/tget_set_d64.c
parentbdbfaddf010cd08abefffa8f5c9c753959413d02 (diff)
downloadmpfr-5e228aa6f9e5e4879163b8fc90738309f900239b.tar.gz
added new configure option --enable-decimal-float to build mpfr_set_decimal64
and mpfr_get_decimal64 (checks _Decimal64, and _GMP_IEEE_FLOATS is defined) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@4191 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tests/tget_set_d64.c')
-rw-r--r--tests/tget_set_d64.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/tget_set_d64.c b/tests/tget_set_d64.c
index f3fe98e59..6fd5d7331 100644
--- a/tests/tget_set_d64.c
+++ b/tests/tget_set_d64.c
@@ -22,14 +22,16 @@ MA 02110-1301, USA. */
#include <stdlib.h> /* for exit */
#include "mpfr-test.h"
-#if WANT_DECIMAL64
+#if MPFR_WANT_DECIMAL_FLOATS
static void
-print_decimal64 (decimal64 d)
+print_decimal64 (_Decimal64 d)
{
union ieee_double_extract x;
+ union ieee_double_decimal64 y;
unsigned int Gh, i;
- x.d = d;
+ y.d64 = d;
+ x.d = y.d;
Gh = x.s.exp >> 6;
printf ("|%d|%d%d%d%d%d|", x.s.sig, Gh >> 4, (Gh >> 3) & 1,
(Gh >> 2) & 1, (Gh >> 1) & 1, Gh & 1);
@@ -53,8 +55,8 @@ static void
check_inf_nan ()
{
mpfr_t x, y;
- decimal64 d;
-
+ _Decimal64 d;
+
mpfr_init2 (x, 123);
mpfr_init2 (y, 123);
@@ -170,7 +172,7 @@ static void
check_random (void)
{
mpfr_t x, y;
- decimal64 d;
+ _Decimal64 d;
int i;
mpfr_init2 (x, 49);
@@ -197,7 +199,7 @@ check_random (void)
mpfr_clear (x);
mpfr_clear (y);
}
-#endif /* WANT_DECIMAL64 */
+#endif /* MPFR_WANT_DECIMAL_FLOATS */
int
main (void)
@@ -205,7 +207,7 @@ main (void)
tests_start_mpfr ();
mpfr_test_init ();
-#if WANT_DECIMAL64
+#if MPFR_WANT_DECIMAL_FLOATS
check_inf_nan ();
check_random ();
#endif