[GRASS-SVN] r30343 - grass/trunk/raster/r.mapcalc

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 25 01:46:44 EST 2008


Author: glynn
Date: 2008-02-25 01:46:44 -0500 (Mon, 25 Feb 2008)
New Revision: 30343

Modified:
   grass/trunk/raster/r.mapcalc/expression.c
Log:
Change format for floating-point constants from %f to %.8g to avoid huge literals



Modified: grass/trunk/raster/r.mapcalc/expression.c
===================================================================
--- grass/trunk/raster/r.mapcalc/expression.c	2008-02-25 06:37:19 UTC (rev 30342)
+++ grass/trunk/raster/r.mapcalc/expression.c	2008-02-25 06:46:44 UTC (rev 30343)
@@ -312,7 +312,7 @@
 	if (e->res_type == CELL_TYPE)
 		sprintf(buff, "%d", e->data.con.ival);
 	else
-		sprintf(buff, "%f", e->data.con.fval);
+		sprintf(buff, "%.8g", e->data.con.fval);
 
 	return strdup(buff);
 }



More information about the grass-commit mailing list