1 #ifndef PGTYPES_NUMERIC
2 #define PGTYPES_NUMERIC
6 #define NUMERIC_POS 0x0000
7 #define NUMERIC_NEG 0x4000
8 #define NUMERIC_NAN 0xC000
9 #define NUMERIC_NULL 0xF000
10 #define NUMERIC_MAX_PRECISION 1000
11 #define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION
12 #define NUMERIC_MIN_DISPLAY_SCALE 0
13 #define NUMERIC_MIN_SIG_DIGITS 16
Datum numeric(PG_FUNCTION_ARGS)
int PGTYPESnumeric_from_double(double d, numeric *dst)
int PGTYPESnumeric_copy(numeric *src, numeric *dst)
int PGTYPESnumeric_from_decimal(decimal *src, numeric *dst)
int PGTYPESnumeric_to_decimal(numeric *src, decimal *dst)
void PGTYPESdecimal_free(decimal *var)
int PGTYPESnumeric_mul(numeric *var1, numeric *var2, numeric *result)
int PGTYPESnumeric_to_long(numeric *nv, long *lp)
int PGTYPESnumeric_to_double(numeric *nv, double *dp)
int PGTYPESnumeric_from_long(signed long int long_val, numeric *var)
int PGTYPESnumeric_to_int(numeric *nv, int *ip)
char * PGTYPESnumeric_to_asc(numeric *num, int dscale)
numeric * PGTYPESnumeric_new(void)
int PGTYPESnumeric_from_int(signed int int_val, numeric *var)
int PGTYPESnumeric_sub(numeric *var1, numeric *var2, numeric *result)
decimal * PGTYPESdecimal_new(void)
numeric * PGTYPESnumeric_from_asc(char *str, char **endptr)
void PGTYPESnumeric_free(numeric *var)
int PGTYPESnumeric_cmp(numeric *var1, numeric *var2)
int PGTYPESnumeric_div(numeric *var1, numeric *var2, numeric *result)
int PGTYPESnumeric_add(numeric *var1, numeric *var2, numeric *result)
unsigned char NumericDigit