Changes between Initial Version and Version 2 of Ticket #1302
- Timestamp:
- 08/20/12 15:16:56 (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1302
- Property Keywords r.out.ascii added
- Property Milestone 6.4.1 → 6.4.4
-
Ticket #1302 – Description
initial v2 6 6 The error is probabely due to the format specification in the fprintf statements in the file formspecific.c: 7 7 8 {{{ 8 9 ****************************************************************** 9 10 /* write MODFLOW ASCII ARRAY */ … … 25 26 } 26 27 ****************************************************************** 27 28 }}} 28 29 29 30 For demonstrating the problem, see the next simple test program 30 31 (I use MINGW gcc 4.5.2 for compiling): 31 32 33 {{{ 32 34 ****************************************************************** 33 35 #include <stdio.h> … … 48 50 } 49 51 ****************************************************************** 52 }}} 50 53 51 54 Running the above test program, the result is: 52 55 56 {{{ 53 57 [1.2555e+0021.2555e+0021.2555e+0021.2555e+0021.2555e+002] 54 58 [-1.2555e+002-1.2555e+002-1.2555e+002-1.2555e+002-1.2555e+002] 59 }}} 55 60 56 61 Changing the format specification as follow: 57 62 63 {{{ 58 64 printf("%*.*e", dp + 7, dp - 1, DCELL); 65 }}} 59 66 60 67 the result became suitable: 61 68 69 {{{ 62 70 [ 1.2555e+002 1.2555e+002 1.2555e+002 1.2555e+002 1.2555e+002] 63 71 [-1.2555e+002-1.2555e+002-1.2555e+002-1.2555e+002-1.2555e+002] 64 72 }}} 65 73 66 74 Sincerely Zoltan