[GRASS-SVN] r44636 - grass/trunk/raster/r.what.color

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 19 22:10:51 EST 2010


Author: hamish
Date: 2010-12-19 19:10:51 -0800 (Sun, 19 Dec 2010)
New Revision: 44636

Modified:
   grass/trunk/raster/r.what.color/main.c
   grass/trunk/raster/r.what.color/r.what.color.html
Log:
show input value to full precision (or near enough); merge from devbr6

Modified: grass/trunk/raster/r.what.color/main.c
===================================================================
--- grass/trunk/raster/r.what.color/main.c	2010-12-20 02:04:40 UTC (rev 44635)
+++ grass/trunk/raster/r.what.color/main.c	2010-12-20 03:10:51 UTC (rev 44636)
@@ -54,10 +54,10 @@
 	    return 0;
 	}
 	if (!Rast_get_d_color(&fval, &red, &grn, &blu, colors)) {
-	    fprintf(stdout, "%f: *\n", fval);
+	    fprintf(stdout, "%.15g: *\n", fval);
 	    return 0;
 	}
-	fprintf(stdout, "%f: ", fval);
+	fprintf(stdout, "%.15g: ", fval);
 	fprintf(stdout, fmt, red, grn, blu);
 	fprintf(stdout, "\n");
 	return 1;

Modified: grass/trunk/raster/r.what.color/r.what.color.html
===================================================================
--- grass/trunk/raster/r.what.color/r.what.color.html	2010-12-20 02:04:40 UTC (rev 44635)
+++ grass/trunk/raster/r.what.color/r.what.color.html	2010-12-20 03:10:51 UTC (rev 44636)
@@ -18,7 +18,7 @@
 <p>
 If the input map is an integer (CELL) map, the category will be
 written as an integer (no decimal point), otherwise it will be written
-in floating point format (<i>printf("%f")</i> format).
+in floating point format (<i>printf("%.15g")</i> format).
 
 <p>
 If the lookup fails for a value, the color will be output as an



More information about the grass-commit mailing list