[GRASS-SVN] r38798 - grass/branches/develbranch_6/raster/r.info
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Aug 20 02:17:16 EDT 2009
Author: hamish
Date: 2009-08-20 02:17:11 -0400 (Thu, 20 Aug 2009)
New Revision: 38798
Modified:
grass/branches/develbranch_6/raster/r.info/main.c
Log:
export floats with correct precision (trac #335)
Modified: grass/branches/develbranch_6/raster/r.info/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.info/main.c 2009-08-19 18:24:00 UTC (rev 38797)
+++ grass/branches/develbranch_6/raster/r.info/main.c 2009-08-20 06:17:11 UTC (rev 38798)
@@ -236,8 +236,12 @@
" Range of data: min = %i max = %i",
(CELL) zmin, (CELL) zmax);
}
+ else if (data_type == FCELL_TYPE) {
+ compose_line(out, " Range of data: min = %.7g max = %.7g",
+ zmin, zmax);
+ }
else {
- compose_line(out, " Range of data: min = %f max = %f",
+ compose_line(out, " Range of data: min = %.15g max = %.15g",
zmin, zmax);
}
}
@@ -316,7 +320,7 @@
fprintf(out, "\n");
}
- else { /* rflag or sflag or tflag or gflag or hflag or mflag */
+ else { /* rflag or sflag or tflag or gflag or hflag or mflag */
if (rflag->answer) {
if (data_type == CELL_TYPE) {
@@ -329,10 +333,15 @@
fprintf(out, "max=%i\n", (CELL) zmax);
}
}
+ else if (data_type == FCELL_TYPE) {
+ fprintf(out, "min=%.7g\n", zmin);
+ fprintf(out, "max=%.7g\n", zmax);
+ }
else {
fprintf(out, "min=%.15g\n", zmin);
fprintf(out, "max=%.15g\n", zmax);
}
+
}
if (gflag->answer) {
More information about the grass-commit
mailing list