Commit 463f1f5c authored by Tom Lane's avatar Tom Lane

Convert all remaining float4 and float8 functions to new fmgr style.

At this point I think it'd be possible to make float4 be pass-by-value
without too much work --- and float8 too on machines where Datum is
8 bytes.  Something to try when the mood strikes, anyway.
parent 92bd532c
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.39 2000/07/14 15:35:44 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/variable.c,v 1.40 2000/08/01 18:29:29 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -566,7 +566,7 @@ parse_random_seed(char *value) ...@@ -566,7 +566,7 @@ parse_random_seed(char *value)
else else
{ {
sscanf(value, "%lf", &seed); sscanf(value, "%lf", &seed);
setseed(&seed); DirectFunctionCall1(setseed, Float8GetDatum(seed));
} }
return (TRUE); return (TRUE);
} }
...@@ -583,7 +583,7 @@ reset_random_seed(void) ...@@ -583,7 +583,7 @@ reset_random_seed(void)
{ {
double seed = 0.5; double seed = 0.5;
setseed(&seed); DirectFunctionCall1(setseed, Float8GetDatum(seed));
return (TRUE); return (TRUE);
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* workings can be found in the book "Software Solutions in C" by * workings can be found in the book "Software Solutions in C" by
* Dale Schumacher, Academic Press, ISBN: 0-12-632360-7. * Dale Schumacher, Academic Press, ISBN: 0-12-632360-7.
* *
* $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.43 2000/07/07 18:49:52 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/cash.c,v 1.44 2000/08/01 18:29:35 tgl Exp $
*/ */
#include <limits.h> #include <limits.h>
...@@ -425,31 +425,31 @@ cash_mi(Cash *c1, Cash *c2) ...@@ -425,31 +425,31 @@ cash_mi(Cash *c1, Cash *c2)
/* cash_mul_flt8() /* cash_mul_flt8()
* Multiply cash by float8. * Multiply cash by float8.
*/ */
Cash * Datum
cash_mul_flt8(Cash *c, float8 *f) cash_mul_flt8(PG_FUNCTION_ARGS)
{ {
Cash *result; Cash c = PG_GETARG_CASH(0);
float8 f = PG_GETARG_FLOAT8(1);
if (!PointerIsValid(f) || !PointerIsValid(c)) Cash result;
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
elog(ERROR, "Memory allocation failed, can't multiply cash");
*result = ((*f) * (*c));
return result; result = c * f;
} /* cash_mul_flt8() */ PG_RETURN_CASH(result);
}
/* flt8_mul_cash() /* flt8_mul_cash()
* Multiply float8 by cash. * Multiply float8 by cash.
*/ */
Cash * Datum
flt8_mul_cash(float8 *f, Cash *c) flt8_mul_cash(PG_FUNCTION_ARGS)
{ {
return cash_mul_flt8(c, f); float8 f = PG_GETARG_FLOAT8(0);
} /* flt8_mul_cash() */ Cash c = PG_GETARG_CASH(1);
Cash result;
result = f * c;
PG_RETURN_CASH(result);
}
/* cash_div_flt8() /* cash_div_flt8()
...@@ -458,53 +458,48 @@ flt8_mul_cash(float8 *f, Cash *c) ...@@ -458,53 +458,48 @@ flt8_mul_cash(float8 *f, Cash *c)
* XXX Don't know if rounding or truncating is correct behavior. * XXX Don't know if rounding or truncating is correct behavior.
* Round for now. - tgl 97/04/15 * Round for now. - tgl 97/04/15
*/ */
Cash * Datum
cash_div_flt8(Cash *c, float8 *f) cash_div_flt8(PG_FUNCTION_ARGS)
{ {
Cash *result; Cash c = PG_GETARG_CASH(0);
float8 f = PG_GETARG_FLOAT8(1);
if (!PointerIsValid(f) || !PointerIsValid(c)) Cash result;
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
elog(ERROR, "Memory allocation failed, can't divide cash");
if (*f == 0.0) if (f == 0.0)
elog(ERROR, "cash_div: divide by 0.0 error"); elog(ERROR, "cash_div: divide by 0.0 error");
*result = rint(*c / *f); result = rint(c / f);
PG_RETURN_CASH(result);
return result; }
} /* cash_div_flt8() */
/* cash_mul_flt4() /* cash_mul_flt4()
* Multiply cash by float4. * Multiply cash by float4.
*/ */
Cash * Datum
cash_mul_flt4(Cash *c, float4 *f) cash_mul_flt4(PG_FUNCTION_ARGS)
{ {
Cash *result; Cash c = PG_GETARG_CASH(0);
float4 f = PG_GETARG_FLOAT4(1);
if (!PointerIsValid(f) || !PointerIsValid(c)) Cash result;
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
elog(ERROR, "Memory allocation failed, can't multiply cash");
*result = ((*f) * (*c));
return result; result = c * f;
} /* cash_mul_flt4() */ PG_RETURN_CASH(result);
}
/* flt4_mul_cash() /* flt4_mul_cash()
* Multiply float4 by float4. * Multiply float4 by cash.
*/ */
Cash * Datum
flt4_mul_cash(float4 *f, Cash *c) flt4_mul_cash(PG_FUNCTION_ARGS)
{ {
return cash_mul_flt4(c, f); float4 f = PG_GETARG_FLOAT4(0);
} /* flt4_mul_cash() */ Cash c = PG_GETARG_CASH(1);
Cash result;
result = f * c;
PG_RETURN_CASH(result);
}
/* cash_div_flt4() /* cash_div_flt4()
...@@ -513,24 +508,19 @@ flt4_mul_cash(float4 *f, Cash *c) ...@@ -513,24 +508,19 @@ flt4_mul_cash(float4 *f, Cash *c)
* XXX Don't know if rounding or truncating is correct behavior. * XXX Don't know if rounding or truncating is correct behavior.
* Round for now. - tgl 97/04/15 * Round for now. - tgl 97/04/15
*/ */
Cash * Datum
cash_div_flt4(Cash *c, float4 *f) cash_div_flt4(PG_FUNCTION_ARGS)
{ {
Cash *result; Cash c = PG_GETARG_CASH(0);
float4 f = PG_GETARG_FLOAT4(1);
if (!PointerIsValid(f) || !PointerIsValid(c)) Cash result;
return NULL;
if (!PointerIsValid(result = palloc(sizeof(Cash))))
elog(ERROR, "Memory allocation failed, can't divide cash");
if (*f == 0.0) if (f == 0.0)
elog(ERROR, "cash_div: divide by 0.0 error"); elog(ERROR, "cash_div: divide by 0.0 error");
*result = rint(*c / *f); result = rint(c / f);
PG_RETURN_CASH(result);
return result; }
} /* cash_div_flt4() */
/* cash_mul_int4() /* cash_mul_int4()
......
This diff is collapsed.
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.41 2000/07/17 03:05:17 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.42 2000/08/01 18:29:35 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -65,7 +65,7 @@ int2out(PG_FUNCTION_ARGS) ...@@ -65,7 +65,7 @@ int2out(PG_FUNCTION_ARGS)
int16 arg1 = PG_GETARG_INT16(0); int16 arg1 = PG_GETARG_INT16(0);
char *result = (char *) palloc(7); /* sign, 5 digits, '\0' */ char *result = (char *) palloc(7); /* sign, 5 digits, '\0' */
itoa((int) arg1, result); pg_itoa(arg1, result);
PG_RETURN_CSTRING(result); PG_RETURN_CSTRING(result);
} }
...@@ -123,7 +123,7 @@ int2vectorout(PG_FUNCTION_ARGS) ...@@ -123,7 +123,7 @@ int2vectorout(PG_FUNCTION_ARGS)
{ {
if (num != 0) if (num != 0)
*rp++ = ' '; *rp++ = ' ';
ltoa(int2Array[num], rp); pg_itoa(int2Array[num], rp);
while (*++rp != '\0') while (*++rp != '\0')
; ;
} }
...@@ -187,7 +187,7 @@ int44out(PG_FUNCTION_ARGS) ...@@ -187,7 +187,7 @@ int44out(PG_FUNCTION_ARGS)
walk = result; walk = result;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {
itoa(an_array[i], walk); pg_ltoa(an_array[i], walk);
while (*++walk != '\0') while (*++walk != '\0')
; ;
*walk++ = ' '; *walk++ = ' ';
...@@ -221,7 +221,7 @@ int4out(PG_FUNCTION_ARGS) ...@@ -221,7 +221,7 @@ int4out(PG_FUNCTION_ARGS)
int32 arg1 = PG_GETARG_INT32(0); int32 arg1 = PG_GETARG_INT32(0);
char *result = (char *) palloc(12); /* sign, 10 digits, '\0' */ char *result = (char *) palloc(12); /* sign, 10 digits, '\0' */
ltoa(arg1, result); pg_ltoa(arg1, result);
PG_RETURN_CSTRING(result); PG_RETURN_CSTRING(result);
} }
...@@ -259,7 +259,7 @@ int2_text(PG_FUNCTION_ARGS) ...@@ -259,7 +259,7 @@ int2_text(PG_FUNCTION_ARGS)
int16 arg1 = PG_GETARG_INT16(0); int16 arg1 = PG_GETARG_INT16(0);
text *result = (text *) palloc(7+VARHDRSZ); /* sign,5 digits, '\0' */ text *result = (text *) palloc(7+VARHDRSZ); /* sign,5 digits, '\0' */
itoa((int) arg1, VARDATA(result)); pg_itoa(arg1, VARDATA(result));
VARATT_SIZEP(result) = strlen(VARDATA(result)) + VARHDRSZ; VARATT_SIZEP(result) = strlen(VARDATA(result)) + VARHDRSZ;
PG_RETURN_TEXT_P(result); PG_RETURN_TEXT_P(result);
} }
...@@ -290,7 +290,7 @@ int4_text(PG_FUNCTION_ARGS) ...@@ -290,7 +290,7 @@ int4_text(PG_FUNCTION_ARGS)
int32 arg1 = PG_GETARG_INT32(0); int32 arg1 = PG_GETARG_INT32(0);
text *result = (text *) palloc(12+VARHDRSZ); /* sign,10 digits,'\0' */ text *result = (text *) palloc(12+VARHDRSZ); /* sign,10 digits,'\0' */
ltoa(arg1, VARDATA(result)); pg_ltoa(arg1, VARDATA(result));
VARATT_SIZEP(result) = strlen(VARDATA(result)) + VARHDRSZ; VARATT_SIZEP(result) = strlen(VARDATA(result)) + VARHDRSZ;
PG_RETURN_TEXT_P(result); PG_RETURN_TEXT_P(result);
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* 1998 Jan Wieck * 1998 Jan Wieck
* *
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.33 2000/07/29 03:26:41 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v 1.34 2000/08/01 18:29:35 tgl Exp $
* *
* ---------- * ----------
*/ */
...@@ -1766,17 +1766,19 @@ numeric_float8(PG_FUNCTION_ARGS) ...@@ -1766,17 +1766,19 @@ numeric_float8(PG_FUNCTION_ARGS)
{ {
Numeric num = PG_GETARG_NUMERIC(0); Numeric num = PG_GETARG_NUMERIC(0);
char *tmp; char *tmp;
float64 result; Datum result;
if (NUMERIC_IS_NAN(num)) if (NUMERIC_IS_NAN(num))
PG_RETURN_FLOAT8(NAN); PG_RETURN_FLOAT8(NAN);
tmp = DatumGetCString(DirectFunctionCall1(numeric_out, tmp = DatumGetCString(DirectFunctionCall1(numeric_out,
NumericGetDatum(num))); NumericGetDatum(num)));
result = float8in(tmp);
result = DirectFunctionCall1(float8in, CStringGetDatum(tmp));
pfree(tmp); pfree(tmp);
PG_RETURN_POINTER(result); PG_RETURN_DATUM(result);
} }
...@@ -1809,17 +1811,19 @@ numeric_float4(PG_FUNCTION_ARGS) ...@@ -1809,17 +1811,19 @@ numeric_float4(PG_FUNCTION_ARGS)
{ {
Numeric num = PG_GETARG_NUMERIC(0); Numeric num = PG_GETARG_NUMERIC(0);
char *tmp; char *tmp;
float32 result; Datum result;
if (NUMERIC_IS_NAN(num)) if (NUMERIC_IS_NAN(num))
PG_RETURN_FLOAT4(NAN); PG_RETURN_FLOAT4((float4) NAN);
tmp = DatumGetCString(DirectFunctionCall1(numeric_out, tmp = DatumGetCString(DirectFunctionCall1(numeric_out,
NumericGetDatum(num))); NumericGetDatum(num)));
result = float4in(tmp);
result = DirectFunctionCall1(float4in, CStringGetDatum(tmp));
pfree(tmp); pfree(tmp);
PG_RETURN_POINTER(result); PG_RETURN_DATUM(result);
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* numutils.c * numutils.c
* utility functions for I/O of built-in numeric types. * utility functions for I/O of built-in numeric types.
* *
* integer: itoa, ltoa * integer: pg_itoa, pg_ltoa
* floating point: ftoa, atof1 * floating point: ftoa, atof1
* *
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.41 2000/07/12 22:59:09 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/numutils.c,v 1.42 2000/08/01 18:29:35 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -116,27 +116,27 @@ pg_atoi(char *s, int size, int c) ...@@ -116,27 +116,27 @@ pg_atoi(char *s, int size, int c)
} }
/* /*
* itoa - converts a short int to its string represention * pg_itoa - converts a short int to its string represention
* *
* Note: * Note:
* previously based on ~ingres/source/gutil/atoi.c * previously based on ~ingres/source/gutil/atoi.c
* now uses vendor's sprintf conversion * now uses vendor's sprintf conversion
*/ */
void void
itoa(int i, char *a) pg_itoa(int16 i, char *a)
{ {
sprintf(a, "%hd", (short) i); sprintf(a, "%hd", (short) i);
} }
/* /*
* ltoa - converts a long int to its string represention * pg_ltoa - converts a long int to its string represention
* *
* Note: * Note:
* previously based on ~ingres/source/gutil/atoi.c * previously based on ~ingres/source/gutil/atoi.c
* now uses vendor's sprintf conversion * now uses vendor's sprintf conversion
*/ */
void void
ltoa(int32 l, char *a) pg_ltoa(int32 l, char *a)
{ {
sprintf(a, "%d", l); sprintf(a, "%d", l);
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.37 2000/07/03 23:09:52 wieck Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/oid.c,v 1.38 2000/08/01 18:29:35 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -79,7 +79,7 @@ oidvectorout(PG_FUNCTION_ARGS) ...@@ -79,7 +79,7 @@ oidvectorout(PG_FUNCTION_ARGS)
{ {
if (num != 0) if (num != 0)
*rp++ = ' '; *rp++ = ' ';
ltoa(oidArray[num], rp); pg_ltoa((int32) oidArray[num], rp);
while (*++rp != '\0') while (*++rp != '\0')
; ;
} }
......
This diff is collapsed.
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: builtins.h,v 1.127 2000/07/30 22:14:04 tgl Exp $ * $Id: builtins.h,v 1.128 2000/08/01 18:29:31 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -141,19 +141,9 @@ extern int namestrcpy(Name name, const char *str); ...@@ -141,19 +141,9 @@ extern int namestrcpy(Name name, const char *str);
extern int namestrcmp(Name name, const char *str); extern int namestrcmp(Name name, const char *str);
/* numutils.c */ /* numutils.c */
/* XXX hack. HP-UX has a ltoa (with different arguments) already. */
#ifdef __hpux
#define ltoa pg_ltoa
#endif /* hpux */
extern int32 pg_atoi(char *s, int size, int c); extern int32 pg_atoi(char *s, int size, int c);
extern void pg_itoa(int16 i, char *a);
/* XXX hack. QNX has itoa and ltoa (with different arguments) already. */ extern void pg_ltoa(int32 l, char *a);
#ifdef __QNX__
#define itoa pg_itoa
#define ltoa pg_ltoa
#endif /* QNX */
extern void itoa(int i, char *a);
extern void ltoa(int32 l, char *a);
/* /*
* Per-opclass comparison functions for new btrees. These are * Per-opclass comparison functions for new btrees. These are
...@@ -172,105 +162,99 @@ extern Datum btcharcmp(PG_FUNCTION_ARGS); ...@@ -172,105 +162,99 @@ extern Datum btcharcmp(PG_FUNCTION_ARGS);
extern Datum btnamecmp(PG_FUNCTION_ARGS); extern Datum btnamecmp(PG_FUNCTION_ARGS);
extern Datum bttextcmp(PG_FUNCTION_ARGS); extern Datum bttextcmp(PG_FUNCTION_ARGS);
/* filename.c */
extern char *filename_in(char *file);
extern char *filename_out(char *s);
/* float.c */ /* float.c */
extern float32 float4in(char *num); extern Datum float4in(PG_FUNCTION_ARGS);
extern char *float4out(float32 num); extern Datum float4out(PG_FUNCTION_ARGS);
extern float64 float8in(char *num); extern Datum float8in(PG_FUNCTION_ARGS);
extern char *float8out(float64 num); extern Datum float8out(PG_FUNCTION_ARGS);
extern float32 float4abs(float32 arg1); extern Datum float4abs(PG_FUNCTION_ARGS);
extern float32 float4um(float32 arg1); extern Datum float4um(PG_FUNCTION_ARGS);
extern float32 float4larger(float32 arg1, float32 arg2); extern Datum float4larger(PG_FUNCTION_ARGS);
extern float32 float4smaller(float32 arg1, float32 arg2); extern Datum float4smaller(PG_FUNCTION_ARGS);
extern float64 float8abs(float64 arg1); extern Datum float8abs(PG_FUNCTION_ARGS);
extern float64 float8um(float64 arg1); extern Datum float8um(PG_FUNCTION_ARGS);
extern float64 float8larger(float64 arg1, float64 arg2); extern Datum float8larger(PG_FUNCTION_ARGS);
extern float64 float8smaller(float64 arg1, float64 arg2); extern Datum float8smaller(PG_FUNCTION_ARGS);
extern float32 float4pl(float32 arg1, float32 arg2); extern Datum float4pl(PG_FUNCTION_ARGS);
extern float32 float4mi(float32 arg1, float32 arg2); extern Datum float4mi(PG_FUNCTION_ARGS);
extern float32 float4mul(float32 arg1, float32 arg2); extern Datum float4mul(PG_FUNCTION_ARGS);
extern float32 float4div(float32 arg1, float32 arg2); extern Datum float4div(PG_FUNCTION_ARGS);
extern float64 float8pl(float64 arg1, float64 arg2); extern Datum float8pl(PG_FUNCTION_ARGS);
extern float64 float8mi(float64 arg1, float64 arg2); extern Datum float8mi(PG_FUNCTION_ARGS);
extern float64 float8mul(float64 arg1, float64 arg2); extern Datum float8mul(PG_FUNCTION_ARGS);
extern float64 float8div(float64 arg1, float64 arg2); extern Datum float8div(PG_FUNCTION_ARGS);
extern bool float4eq(float32 arg1, float32 arg2); extern Datum float4eq(PG_FUNCTION_ARGS);
extern bool float4ne(float32 arg1, float32 arg2); extern Datum float4ne(PG_FUNCTION_ARGS);
extern bool float4lt(float32 arg1, float32 arg2); extern Datum float4lt(PG_FUNCTION_ARGS);
extern bool float4le(float32 arg1, float32 arg2); extern Datum float4le(PG_FUNCTION_ARGS);
extern bool float4gt(float32 arg1, float32 arg2); extern Datum float4gt(PG_FUNCTION_ARGS);
extern bool float4ge(float32 arg1, float32 arg2); extern Datum float4ge(PG_FUNCTION_ARGS);
extern bool float8eq(float64 arg1, float64 arg2); extern Datum float8eq(PG_FUNCTION_ARGS);
extern bool float8ne(float64 arg1, float64 arg2); extern Datum float8ne(PG_FUNCTION_ARGS);
extern bool float8lt(float64 arg1, float64 arg2); extern Datum float8lt(PG_FUNCTION_ARGS);
extern bool float8le(float64 arg1, float64 arg2); extern Datum float8le(PG_FUNCTION_ARGS);
extern bool float8gt(float64 arg1, float64 arg2); extern Datum float8gt(PG_FUNCTION_ARGS);
extern bool float8ge(float64 arg1, float64 arg2); extern Datum float8ge(PG_FUNCTION_ARGS);
extern float64 ftod(float32 num); extern Datum ftod(PG_FUNCTION_ARGS);
extern Datum i4tod(PG_FUNCTION_ARGS); extern Datum i4tod(PG_FUNCTION_ARGS);
extern Datum i2tod(PG_FUNCTION_ARGS); extern Datum i2tod(PG_FUNCTION_ARGS);
extern float32 dtof(float64 num); extern Datum dtof(PG_FUNCTION_ARGS);
extern int32 dtoi4(float64 num); extern Datum dtoi4(PG_FUNCTION_ARGS);
extern Datum dtoi2(PG_FUNCTION_ARGS); extern Datum dtoi2(PG_FUNCTION_ARGS);
extern Datum i4tof(PG_FUNCTION_ARGS); extern Datum i4tof(PG_FUNCTION_ARGS);
extern Datum i2tof(PG_FUNCTION_ARGS); extern Datum i2tof(PG_FUNCTION_ARGS);
extern int32 ftoi4(float32 num); extern Datum ftoi4(PG_FUNCTION_ARGS);
extern Datum ftoi2(PG_FUNCTION_ARGS); extern Datum ftoi2(PG_FUNCTION_ARGS);
extern Datum text_float8(PG_FUNCTION_ARGS); extern Datum text_float8(PG_FUNCTION_ARGS);
extern Datum text_float4(PG_FUNCTION_ARGS); extern Datum text_float4(PG_FUNCTION_ARGS);
extern Datum float8_text(PG_FUNCTION_ARGS); extern Datum float8_text(PG_FUNCTION_ARGS);
extern Datum float4_text(PG_FUNCTION_ARGS); extern Datum float4_text(PG_FUNCTION_ARGS);
extern float64 dround(float64 arg1); extern Datum dround(PG_FUNCTION_ARGS);
extern float64 dtrunc(float64 arg1); extern Datum dtrunc(PG_FUNCTION_ARGS);
extern float64 dsqrt(float64 arg1); extern Datum dsqrt(PG_FUNCTION_ARGS);
extern float64 dcbrt(float64 arg1); extern Datum dcbrt(PG_FUNCTION_ARGS);
extern float64 dpow(float64 arg1, float64 arg2); extern Datum dpow(PG_FUNCTION_ARGS);
extern float64 dexp(float64 arg1); extern Datum dexp(PG_FUNCTION_ARGS);
extern float64 dlog1(float64 arg1); extern Datum dlog1(PG_FUNCTION_ARGS);
extern float64 dlog10(float64 arg1); extern Datum dlog10(PG_FUNCTION_ARGS);
extern float64 dacos(float64 arg1); extern Datum dacos(PG_FUNCTION_ARGS);
extern float64 dasin(float64 arg1); extern Datum dasin(PG_FUNCTION_ARGS);
extern float64 datan(float64 arg1); extern Datum datan(PG_FUNCTION_ARGS);
extern float64 datan2(float64 arg1, float64 arg2); extern Datum datan2(PG_FUNCTION_ARGS);
extern float64 dcos(float64 arg1); extern Datum dcos(PG_FUNCTION_ARGS);
extern float64 dcot(float64 arg1); extern Datum dcot(PG_FUNCTION_ARGS);
extern float64 dsin(float64 arg1); extern Datum dsin(PG_FUNCTION_ARGS);
extern float64 dtan(float64 arg1); extern Datum dtan(PG_FUNCTION_ARGS);
extern float64 degrees(float64 arg1); extern Datum degrees(PG_FUNCTION_ARGS);
extern float64 dpi(void); extern Datum dpi(PG_FUNCTION_ARGS);
extern float64 radians(float64 arg1); extern Datum radians(PG_FUNCTION_ARGS);
extern float64 dtan(float64 arg1); extern Datum drandom(PG_FUNCTION_ARGS);
extern float64 drandom(void); extern Datum setseed(PG_FUNCTION_ARGS);
extern int32 setseed(float64 seed);
extern Datum float8_accum(PG_FUNCTION_ARGS); extern Datum float8_accum(PG_FUNCTION_ARGS);
extern Datum float4_accum(PG_FUNCTION_ARGS); extern Datum float4_accum(PG_FUNCTION_ARGS);
extern Datum float8_avg(PG_FUNCTION_ARGS); extern Datum float8_avg(PG_FUNCTION_ARGS);
extern Datum float8_variance(PG_FUNCTION_ARGS); extern Datum float8_variance(PG_FUNCTION_ARGS);
extern Datum float8_stddev(PG_FUNCTION_ARGS); extern Datum float8_stddev(PG_FUNCTION_ARGS);
extern Datum float48pl(PG_FUNCTION_ARGS);
extern float64 float48pl(float32 arg1, float64 arg2); extern Datum float48mi(PG_FUNCTION_ARGS);
extern float64 float48mi(float32 arg1, float64 arg2); extern Datum float48mul(PG_FUNCTION_ARGS);
extern float64 float48mul(float32 arg1, float64 arg2); extern Datum float48div(PG_FUNCTION_ARGS);
extern float64 float48div(float32 arg1, float64 arg2); extern Datum float84pl(PG_FUNCTION_ARGS);
extern float64 float84pl(float64 arg1, float32 arg2); extern Datum float84mi(PG_FUNCTION_ARGS);
extern float64 float84mi(float64 arg1, float32 arg2); extern Datum float84mul(PG_FUNCTION_ARGS);
extern float64 float84mul(float64 arg1, float32 arg2); extern Datum float84div(PG_FUNCTION_ARGS);
extern float64 float84div(float64 arg1, float32 arg2); extern Datum float48eq(PG_FUNCTION_ARGS);
extern bool float48eq(float32 arg1, float64 arg2); extern Datum float48ne(PG_FUNCTION_ARGS);
extern bool float48ne(float32 arg1, float64 arg2); extern Datum float48lt(PG_FUNCTION_ARGS);
extern bool float48lt(float32 arg1, float64 arg2); extern Datum float48le(PG_FUNCTION_ARGS);
extern bool float48le(float32 arg1, float64 arg2); extern Datum float48gt(PG_FUNCTION_ARGS);
extern bool float48gt(float32 arg1, float64 arg2); extern Datum float48ge(PG_FUNCTION_ARGS);
extern bool float48ge(float32 arg1, float64 arg2); extern Datum float84eq(PG_FUNCTION_ARGS);
extern bool float84eq(float64 arg1, float32 arg2); extern Datum float84ne(PG_FUNCTION_ARGS);
extern bool float84ne(float64 arg1, float32 arg2); extern Datum float84lt(PG_FUNCTION_ARGS);
extern bool float84lt(float64 arg1, float32 arg2); extern Datum float84le(PG_FUNCTION_ARGS);
extern bool float84le(float64 arg1, float32 arg2); extern Datum float84gt(PG_FUNCTION_ARGS);
extern bool float84gt(float64 arg1, float32 arg2); extern Datum float84ge(PG_FUNCTION_ARGS);
extern bool float84ge(float64 arg1, float32 arg2);
/* misc.c */ /* misc.c */
extern Datum nullvalue(PG_FUNCTION_ARGS); extern Datum nullvalue(PG_FUNCTION_ARGS);
......
...@@ -25,13 +25,13 @@ extern bool cash_ge(Cash *c1, Cash *c2); ...@@ -25,13 +25,13 @@ extern bool cash_ge(Cash *c1, Cash *c2);
extern Cash *cash_pl(Cash *c1, Cash *c2); extern Cash *cash_pl(Cash *c1, Cash *c2);
extern Cash *cash_mi(Cash *c1, Cash *c2); extern Cash *cash_mi(Cash *c1, Cash *c2);
extern Cash *cash_mul_flt8(Cash *c, float8 *f); extern Datum cash_mul_flt8(PG_FUNCTION_ARGS);
extern Cash *cash_div_flt8(Cash *c, float8 *f); extern Datum cash_div_flt8(PG_FUNCTION_ARGS);
extern Cash *flt8_mul_cash(float8 *f, Cash *c); extern Datum flt8_mul_cash(PG_FUNCTION_ARGS);
extern Cash *cash_mul_flt4(Cash *c, float4 *f); extern Datum cash_mul_flt4(PG_FUNCTION_ARGS);
extern Cash *cash_div_flt4(Cash *c, float4 *f); extern Datum cash_div_flt4(PG_FUNCTION_ARGS);
extern Cash *flt4_mul_cash(float4 *f, Cash *c); extern Datum flt4_mul_cash(PG_FUNCTION_ARGS);
extern Datum cash_mul_int4(PG_FUNCTION_ARGS); extern Datum cash_mul_int4(PG_FUNCTION_ARGS);
extern Datum cash_div_int4(PG_FUNCTION_ARGS); extern Datum cash_div_int4(PG_FUNCTION_ARGS);
......
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