From 95fb8c7107cb580e2b973e76c4c104bff50d9838 Mon Sep 17 00:00:00 2001 From: tradke Date: Thu, 2 May 2002 09:18:42 +0000 Subject: Fixed bug in choosing between decimal and exponential notation for info output. Also fixed the maximum absolute value to be printed in decimal notation. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@123 b589c3ab-70e8-4b4d-a09f-cba2dd200880 --- src/OutputInfo.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/OutputInfo.c b/src/OutputInfo.c index 071f1a8..5bc12b1 100644 --- a/src/OutputInfo.c +++ b/src/OutputInfo.c @@ -28,21 +28,21 @@ CCTK_FILEVERSION(CactusBase_IOBasic_OutputInfo_c) /* #define IOBASIC_DEBUG 1 */ /* the number at which to switch from decimal to exponential notation */ -#define DECIMAL_PRECISION 1.0e-8 -#define DECIMAL_TOOBIG 1.0e+8 -#define USE_DECIMAL_NOTATION(x) ((fabs ((double) x) > DECIMAL_PRECISION) || \ - ((x) == 0.0) || \ - (fabs ((double) x) < DECIMAL_TOOBIG)) +#define DECIMAL_SMALLEST 1.0e-8 +#define DECIMAL_TOOBIG 1.0e+3 +#define USE_DECIMAL_NOTATION(x) ((x) == 0.0 || \ + (fabs ((double) x) >= DECIMAL_SMALLEST && \ + fabs ((double) x) < DECIMAL_TOOBIG)) #define PRINT_FORMATTED_REDUCTION_VALUE(reduction) \ if (reduction->is_valid) \ { \ if (USE_DECIMAL_NOTATION (reduction->value)) \ { \ - printf ("%13.8f |", reduction->value); \ + printf ("% 13.8f |", reduction->value); \ } \ else \ { \ - printf ("%11.6e |", reduction->value); \ + printf ("% 11.6e |", reduction->value); \ } \ } \ else \ -- cgit v1.2.3