[GRASS-SVN] r43566 - grass/branches/releasebranch_6_4/raster/r.info

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Sep 21 06:47:08 EDT 2010


Author: neteler
Date: 2010-09-21 10:47:07 +0000 (Tue, 21 Sep 2010)
New Revision: 43566

Modified:
   grass/branches/releasebranch_6_4/raster/r.info/main.c
Log:
backport: export floats with correct precision (trac #335)

Modified: grass/branches/releasebranch_6_4/raster/r.info/main.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.info/main.c	2010-09-21 10:46:11 UTC (rev 43565)
+++ grass/branches/releasebranch_6_4/raster/r.info/main.c	2010-09-21 10:47:07 UTC (rev 43566)
@@ -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