Changeset: bea76bf57c9b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bea76bf57c9b
Modified Files:
clients/mapiclient/mclient.c
Branch: Dec2016
Log Message:
Normalize -0 to 0 when testing.
diffs (31 lines):
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1154,7 +1154,10 @@ TESTrenderer(MapiHdl hdl)
strcmp(tp, "dbl") == 0) {
char buf[32];
int j;
- double v = strtod(s, NULL);
+ double v;
+ if (strcmp(s, "-0") == 0) /* normalize -0 */
+ s = "0";
+ v = strtod(s, NULL);
for (j = 4; j < 11; j++) {
snprintf(buf, sizeof(buf), "%.*g", j,
v);
if (v == strtod(buf, NULL))
@@ -1164,10 +1167,13 @@ TESTrenderer(MapiHdl hdl)
} else if (strcmp(tp, "real") == 0) {
char buf[32];
int j;
+ float v;
+ if (strcmp(s, "-0") == 0) /* normalize -0 */
+ s = "0";
#ifdef HAVE_STRTOF
- float v = strtof(s, NULL);
+ v = strtof(s, NULL);
#else
- float v = (float) strtod(s, NULL);
+ v = (float) strtod(s, NULL);
#endif
for (j = 4; j < 6; j++) {
snprintf(buf, sizeof(buf), "%.*g", j,
v);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list