[GRASS-SVN] r55122 - grass/branches/releasebranch_6_4/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 20 00:43:59 PST 2013


Author: hamish
Date: 2013-02-20 00:43:59 -0800 (Wed, 20 Feb 2013)
New Revision: 55122

Modified:
   grass/branches/releasebranch_6_4/lib/gis/color_write.c
Log:
revert r54938. see #335 comment:23

Modified: grass/branches/releasebranch_6_4/lib/gis/color_write.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/gis/color_write.c	2013-02-19 23:02:41 UTC (rev 55121)
+++ grass/branches/releasebranch_6_4/lib/gis/color_write.c	2013-02-20 08:43:59 UTC (rev 55122)
@@ -121,7 +121,7 @@
     fprintf(fd, "%% %s %s\n", str1, str2);
 
     if (colors->shift) {
-	sprintf(str2, "%.17g", (double)colors->shift);
+	sprintf(str2, "%.15g", (double)colors->shift);
 	G_trim_decimal(str2);
 	fprintf(fd, "shift:%s\n", str2);
     }
@@ -169,7 +169,7 @@
 	if (rule->low.value == dmin)
 	    format_min(str, (double)rule->low.value);
 	else {
-	    sprintf(str, "%.17g", (double)rule->low.value);
+	    sprintf(str, "%.15g", (double)rule->low.value);
 	    G_trim_decimal(str);
 	}
 	fprintf(fd, "%s:%d", str, (int)rule->low.red);
@@ -180,7 +180,7 @@
 	    if (rule->high.value == dmax)
 		format_max(str, (double)rule->high.value);
 	    else {
-		sprintf(str, "%.17g", (double)rule->high.value);
+		sprintf(str, "%.15g", (double)rule->high.value);
 		G_trim_decimal(str);
 	    }
 	    fprintf(fd, " %s:%d", str, (int)rule->high.red);
@@ -246,16 +246,16 @@
 {
     double dtmp;
 
-    sprintf(str, "%.17g", dval);
+    sprintf(str, "%.15g", dval);
     /* Note that G_trim_decimal() does not trim e.g. 1.0000000e-20 */
     G_trim_decimal(str);
     sscanf(str, "%lf", &dtmp);
     if (dtmp != dval) {  /* if no zeros after decimal point were trimmed */
 	/* lower dval by GRASS_EPSILON fraction */
 	if (dval > 0)
-	    sprintf(str, "%.17g", dval * (1 - GRASS_EPSILON));
+	    sprintf(str, "%.15g", dval * (1 - GRASS_EPSILON));
 	else
-	    sprintf(str, "%.17g", dval * (1 + GRASS_EPSILON));
+	    sprintf(str, "%.15g", dval * (1 + GRASS_EPSILON));
     }
 
     return 0;
@@ -265,16 +265,16 @@
 {
     double dtmp;
 
-    sprintf(str, "%.17g", dval);
+    sprintf(str, "%.15g", dval);
     /* Note that G_trim_decimal() does not trim e.g. 1.0000000e-20 */
     G_trim_decimal(str);
     sscanf(str, "%lf", &dtmp);
     if (dtmp != dval) {  /* if  no zeros after decimal point were trimmed */
 	/* increase dval by by GRASS_EPSILON fraction */
 	if (dval > 0)
-	    sprintf(str, "%.17g", dval * (1 + GRASS_EPSILON));
+	    sprintf(str, "%.15g", dval * (1 + GRASS_EPSILON));
 	else
-	    sprintf(str, "%.17g", dval * (1 - GRASS_EPSILON));
+	    sprintf(str, "%.15g", dval * (1 - GRASS_EPSILON));
     }
 
     return 0;



More information about the grass-commit mailing list