41 #define EPSILON 1.0E-06
44 #define FPzero(A) (fabs(A) <= EPSILON)
49 return A == B || fabs(A - B) <=
EPSILON;
55 return A != B && fabs(A - B) >
EPSILON;
82 #define FPzero(A) ((A) == 0)
83 #define FPeq(A,B) ((A) == (B))
84 #define FPne(A,B) ((A) != (B))
85 #define FPlt(A,B) ((A) < (B))
86 #define FPle(A,B) ((A) <= (B))
87 #define FPgt(A,B) ((A) > (B))
88 #define FPge(A,B) ((A) >= (B))
91 #define HYPOT(A, B) pg_hypot(A, B)
175 static inline Point *
185 #define PG_GETARG_POINT_P(n) DatumGetPointP(PG_GETARG_DATUM(n))
186 #define PG_RETURN_POINT_P(x) return PointPGetDatum(x)
198 #define PG_GETARG_LSEG_P(n) DatumGetLsegP(PG_GETARG_DATUM(n))
199 #define PG_RETURN_LSEG_P(x) return LsegPGetDatum(x)
216 #define PG_GETARG_PATH_P(n) DatumGetPathP(PG_GETARG_DATUM(n))
217 #define PG_GETARG_PATH_P_COPY(n) DatumGetPathPCopy(PG_GETARG_DATUM(n))
218 #define PG_RETURN_PATH_P(x) return PathPGetDatum(x)
230 #define PG_GETARG_LINE_P(n) DatumGetLineP(PG_GETARG_DATUM(n))
231 #define PG_RETURN_LINE_P(x) return LinePGetDatum(x)
243 #define PG_GETARG_BOX_P(n) DatumGetBoxP(PG_GETARG_DATUM(n))
244 #define PG_RETURN_BOX_P(x) return BoxPGetDatum(x)
261 #define PG_GETARG_POLYGON_P(n) DatumGetPolygonP(PG_GETARG_DATUM(n))
262 #define PG_GETARG_POLYGON_P_COPY(n) DatumGetPolygonPCopy(PG_GETARG_DATUM(n))
263 #define PG_RETURN_POLYGON_P(x) return PolygonPGetDatum(x)
275 #define PG_GETARG_CIRCLE_P(n) DatumGetCircleP(PG_GETARG_DATUM(n))
276 #define PG_RETURN_CIRCLE_P(x) return CirclePGetDatum(x)
#define FLEXIBLE_ARRAY_MEMBER
#define PG_DETOAST_DATUM_COPY(datum)
#define PG_DETOAST_DATUM(datum)
static Datum PathPGetDatum(const PATH *X)
static LINE * DatumGetLineP(Datum X)
static bool FPlt(double A, double B)
static PATH * DatumGetPathP(Datum X)
static Point * DatumGetPointP(Datum X)
static POLYGON * DatumGetPolygonPCopy(Datum X)
static CIRCLE * DatumGetCircleP(Datum X)
static Datum LsegPGetDatum(const LSEG *X)
static bool FPge(double A, double B)
static Datum PolygonPGetDatum(const POLYGON *X)
static POLYGON * DatumGetPolygonP(Datum X)
static BOX * DatumGetBoxP(Datum X)
static Datum LinePGetDatum(const LINE *X)
float8 pg_hypot(float8 x, float8 y)
static Datum PointPGetDatum(const Point *X)
static bool FPne(double A, double B)
static Datum CirclePGetDatum(const CIRCLE *X)
static PATH * DatumGetPathPCopy(Datum X)
static bool FPgt(double A, double B)
static LSEG * DatumGetLsegP(Datum X)
static bool FPle(double A, double B)
static Datum BoxPGetDatum(const BOX *X)
static bool FPeq(double A, double B)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)