diff options
author | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2002-05-02 09:18:42 +0000 |
---|---|---|
committer | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2002-05-02 09:18:42 +0000 |
commit | 95fb8c7107cb580e2b973e76c4c104bff50d9838 (patch) | |
tree | 3e6b1e0c18829ce931674ec152d10767b99f0f17 | |
parent | 6ac9acb632a460716dea99f28e3e5cb5cec798b3 (diff) |
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
-rw-r--r-- | src/OutputInfo.c | 14 |
1 files 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 \ |