1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

- xpath.c result/XPath/expr/floats : clarified and cleanup

printing of abnormal floats in tests.
Daniel
This commit is contained in:
Daniel Veillard
2001-05-03 10:49:20 +00:00
parent a2bc368bc9
commit 357c960e40
5 changed files with 32 additions and 14 deletions

15
xpath.c
View File

@ -597,7 +597,20 @@ xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth) {
else fprintf(output, "false\n");
break;
case XPATH_NUMBER:
fprintf(output, "Object is a number : %0g\n", cur->floatval);
switch (isinf(cur->floatval)) {
case 1:
fprintf(output, "Object is a number : +Infinity\n");
break;
case -1:
fprintf(output, "Object is a number : -Infinity\n");
break;
default:
if (isnan(cur->floatval)) {
fprintf(output, "Object is a number : NaN\n");
} else {
fprintf(output, "Object is a number : %0g\n", cur->floatval);
}
}
break;
case XPATH_STRING:
fprintf(output, "Object is a string : ");