9 #define ECPGdebug(X,Y) ECPGdebug((X)+100,(Y))
11 #line 1 "dec_test.pgc"
20 #line 1 "regression.h"
27 #line 8 "dec_test.pgc"
31 #line 1 "printf_hack.h"
62 #line 10 "dec_test.pgc"
73 char*
decs[] = {
"2E394",
"-2",
".794",
"3.44",
"592.49E21",
"-32.84e4",
74 "2E-394",
".1E-2",
"+.0",
"-592.49E-07",
"+32.84e-4",
75 ".500001",
"-.5000001",
76 "1234567890123456789012345678.91",
78 "1234567890123456789012345678.921",
95 int i,
j, k, q, r, count = 0;
108 printf(
"dec[%d,0]: r: %d\n",
i, r);
113 decarr[count++] = dec;
136 printf(
"dec[%d,6]: %ld (r: %d)\n",
i, r?0L:l, r);
143 printf(
"dec[%d,7]: %s (r: %d - cmp: %d)\n",
i,
buf, r, q);
148 printf(
"dec[%d,8]: %d (r: %d)\n",
i, r?0:k, r);
155 printf(
"dec[%d,9]: %s (r: %d - cmp: %d)\n",
i,
buf, r, q);
176 decarr[count++] = dec;
179 printf(
"dec[%d]: %sNULL\n", count-1,
181 printf(
"dec[0]: %sNULL\n",
189 for (
i = 0;
i < count;
i++)
191 for (
j = 0;
j < count;
j++)
210 r =
decsub(decarr[
i], decarr[
j], &s);
222 r =
decmul(decarr[
i], decarr[
j], &m);
234 r =
decdiv(decarr[
i], decarr[
j], &d);
248 for (
i = 0;
i < count;
i++)
266 printf(
"(no errno set) - ");
269 printf(
"(errno == ECPG_INFORMIX_NUM_OVERFLOW) - ");
272 printf(
"(errno == ECPG_INFORMIX_NUM_UNDERFLOW) - ");
275 printf(
"(errno == PGTYPES_NUM_OVERFLOW) - ");
278 printf(
"(errno == PGTYPES_NUM_UNDERFLOW) - ");
281 printf(
"(errno == PGTYPES_NUM_BAD_NUMERIC) - ");
284 printf(
"(errno == PGTYPES_NUM_DIVIDE_ZERO) - ");
287 printf(
"(unknown errno (%d))\n", errno);
#define PGTYPES_NUM_BAD_NUMERIC
#define PGTYPES_NUM_OVERFLOW
#define PGTYPES_NUM_UNDERFLOW
#define PGTYPES_NUM_DIVIDE_ZERO
void PGTYPESdecimal_free(decimal *var)
decimal * PGTYPESdecimal_new(void)
static void convert(const int32 val, char *const buf)