|
@@ -125,7 +125,7 @@ static void write_new_colors(FILE * fd, struct Colors *colors)
|
|
|
fprintf(fd, "%% %s %s\n", str1, str2);
|
|
|
|
|
|
if (colors->shift) {
|
|
|
- sprintf(str2, "%.15g", (double)colors->shift);
|
|
|
+ sprintf(str2, "%.17g", (double)colors->shift);
|
|
|
G_trim_decimal(str2);
|
|
|
fprintf(fd, "shift:%s\n", str2);
|
|
|
}
|
|
@@ -172,7 +172,7 @@ static void write_rules(FILE * fd, struct _Color_Rule_ *crules, DCELL dmin,
|
|
|
if (rule->low.value == dmin)
|
|
|
format_min(str, (double)rule->low.value);
|
|
|
else {
|
|
|
- sprintf(str, "%.15g", (double)rule->low.value);
|
|
|
+ sprintf(str, "%.17g", (double)rule->low.value);
|
|
|
G_trim_decimal(str);
|
|
|
}
|
|
|
fprintf(fd, "%s:%d", str, (int)rule->low.red);
|
|
@@ -183,7 +183,7 @@ static void write_rules(FILE * fd, struct _Color_Rule_ *crules, DCELL dmin,
|
|
|
if (rule->high.value == dmax)
|
|
|
format_max(str, (double)rule->high.value);
|
|
|
else {
|
|
|
- sprintf(str, "%.15g", (double)rule->high.value);
|
|
|
+ sprintf(str, "%.17g", (double)rule->high.value);
|
|
|
G_trim_decimal(str);
|
|
|
}
|
|
|
fprintf(fd, " %s:%d", str, (int)rule->high.red);
|
|
@@ -245,16 +245,16 @@ static void format_min(char *str, double dval)
|
|
|
{
|
|
|
double dtmp;
|
|
|
|
|
|
- sprintf(str, "%.15g", dval);
|
|
|
+ sprintf(str, "%.17g", 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, "%.15g", dval * (1 - GRASS_EPSILON));
|
|
|
+ sprintf(str, "%.17g", dval * (1 - GRASS_EPSILON));
|
|
|
else
|
|
|
- sprintf(str, "%.15g", dval * (1 + GRASS_EPSILON));
|
|
|
+ sprintf(str, "%.17g", dval * (1 + GRASS_EPSILON));
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -263,15 +263,15 @@ static void format_max(char *str, double dval)
|
|
|
{
|
|
|
double dtmp;
|
|
|
|
|
|
- sprintf(str, "%.15g", dval);
|
|
|
+ sprintf(str, "%.17g", 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, "%.15g", dval * (1 + GRASS_EPSILON));
|
|
|
+ sprintf(str, "%.17g", dval * (1 + GRASS_EPSILON));
|
|
|
else
|
|
|
- sprintf(str, "%.15g", dval * (1 - GRASS_EPSILON));
|
|
|
+ sprintf(str, "%.17g", dval * (1 - GRASS_EPSILON));
|
|
|
}
|
|
|
}
|