[GRASS-SVN] r38799 - grass/trunk/raster/r.info
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Aug 20 02:20:11 EDT 2009
Author: hamish
Date: 2009-08-20 02:20:07 -0400 (Thu, 20 Aug 2009)
New Revision: 38799
Modified:
grass/trunk/raster/r.info/main.c
Log:
export floats with correct precision (trac #335; merge from devbr6)
Modified: grass/trunk/raster/r.info/main.c
===================================================================
--- grass/trunk/raster/r.info/main.c 2009-08-20 06:17:11 UTC (rev 38798)
+++ grass/trunk/raster/r.info/main.c 2009-08-20 06:20:07 UTC (rev 38799)
@@ -238,8 +238,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);
}
}
@@ -318,7 +322,7 @@
fprintf(out, "\n");
}
- else { /* rflag or sflag or tflag or gflag or hflag or mflag */
+ else { /* r,s,t,g,h, or m flag */
if (rflag->answer) {
if (data_type == CELL_TYPE) {
@@ -331,10 +335,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