38 if (sscanf(str,
" ( %lf , %lf )", &x, &y) != 2)
40 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
41 errmsg(
"invalid input syntax for type %s: \"%s\"",
58 result =
psprintf(
"(%g,%g)", complex->
x, complex->
y);
112 result->
x = a->
x + b->
x;
113 result->
y = a->
y + b->
y;
129 #define Mag(c) ((c)->x*(c)->x + (c)->y*(c)->y) 134 double amag =
Mag(a),
#define PG_RETURN_POINTER(x)
char * psprintf(const char *fmt,...)
StringInfoData * StringInfo
#define PG_RETURN_INT32(x)
int errcode(int sqlerrcode)
Datum complex_abs_ge(PG_FUNCTION_ARGS)
Datum complex_send(PG_FUNCTION_ARGS)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_BYTEA_P(x)
Datum complex_recv(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(complex_in)
Datum complex_abs_eq(PG_FUNCTION_ARGS)
Datum complex_abs_cmp(PG_FUNCTION_ARGS)
#define PG_RETURN_BOOL(x)
Datum complex_abs_gt(PG_FUNCTION_ARGS)
static int complex_abs_cmp_internal(Complex *a, Complex *b)
#define ereport(elevel,...)
Datum complex_in(PG_FUNCTION_ARGS)
Datum complex_add(PG_FUNCTION_ARGS)
#define PG_RETURN_CSTRING(x)
int errmsg(const char *fmt,...)
#define PG_GETARG_CSTRING(n)
Datum complex_abs_lt(PG_FUNCTION_ARGS)
Datum complex_abs_le(PG_FUNCTION_ARGS)
Datum complex_out(PG_FUNCTION_ARGS)