Commit 9a990293 authored by Doug Nazar's avatar Doug Nazar Committed by Sebastian Dröge

orctest: Print full float/double information in verbose mode

parent 55782169
Pipeline #65127 passed with stage
in 3 minutes and 11 seconds
......@@ -39,6 +39,7 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <inttypes.h>
#ifdef _MSC_VER
#define snprintf _snprintf
......@@ -550,14 +551,20 @@ print_array_val_float (OrcArray *array, int i, int j)
switch (array->element_size) {
case 4:
if (isnan(*(float *)ptr)) {
if (_orc_test_verbose) {
printf(" %12.5g [%08x]", *(float *)ptr, *(orc_uint32 *)ptr);
} else if (isnan(*(float *)ptr)) {
printf(" nan %08x", *(orc_uint32 *)ptr);
} else {
printf(" %12.5g", *(float *)ptr);
}
break;
case 8:
if (_orc_test_verbose) {
printf(" %12.5g [%016"PRIx64"]", *(double *)ptr, *(orc_uint64 *)ptr);
} else {
printf(" %12.5g", *(double *)ptr);
}
break;
default:
printf(" ERROR");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment