31 #define M_PI 3.14159265358979323846
35 #define RADIANS_PER_DEGREE 0.0174532925199432957692
40 #if defined(WIN32) && !defined(NAN)
41 static const uint32 nan[2] = {0xffffffff, 0x7fffffff};
43 #define NAN (*(const double *) nan)
47 #define MAXFLOATWIDTH 64
48 #define MAXDOUBLEWIDTH 128
53 #define CHECKFLOATVAL(val, inf_is_valid, zero_is_valid) \
55 if (isinf(val) && !(inf_is_valid)) \
57 (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), \
58 errmsg("value out of range: overflow"))); \
60 if ((val) == 0.0 && !(zero_is_valid)) \
62 (errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE), \
63 errmsg("value out of range: underflow"))); \
93 static double sind_q1(
double x);
94 static double cosd_q1(
double x);
107 static double cbrt(
double x);
125 return (
double) INFINITY;
133 return (
double) (HUGE_VAL * HUGE_VAL);
142 #if (_MSC_VER >= 1800)
143 #pragma warning(disable:4756)
150 return (
float) INFINITY;
152 #if (_MSC_VER >= 1800)
153 #pragma warning(default:4756)
161 return (
float) (HUGE_VAL * HUGE_VAL);
169 #if defined(NAN) && !(defined(__NetBSD__) && defined(__mips__))
174 return (
double) (0.0 / 0.0);
186 return (
float) (0.0 / 0.0);
201 int inf =
isinf(val);
234 while (*num !=
'\0' && isspace((
unsigned char) *num))
243 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
244 errmsg(
"invalid input syntax for type real: \"%s\"",
248 val = strtod(num, &endptr);
251 if (endptr == num || errno != 0)
253 int save_errno = errno;
300 else if (save_errno == ERANGE)
309 if (val == 0.0 || val >= HUGE_VAL || val <= -HUGE_VAL)
311 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
312 errmsg(
"\"%s\" is out of range for type real",
317 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
318 errmsg(
"invalid input syntax for type real: \"%s\"",
321 #ifdef HAVE_BUGGY_SOLARIS_STRTOD
329 if (endptr != num && endptr[-1] ==
'\0')
335 while (*endptr !=
'\0' && isspace((
unsigned char) *endptr))
341 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
342 errmsg(
"invalid input syntax for type real: \"%s\"",
370 strcpy(ascii,
"Infinity");
373 strcpy(ascii,
"-Infinity");
445 const char *type_name,
const char *orig_string)
451 while (*num !=
'\0' && isspace((
unsigned char) *num))
460 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
461 errmsg(
"invalid input syntax for type %s: \"%s\"",
462 type_name, orig_string)));
465 val = strtod(num, &endptr);
468 if (endptr == num || errno != 0)
470 int save_errno = errno;
517 else if (save_errno == ERANGE)
530 if (val == 0.0 || val >= HUGE_VAL || val <= -HUGE_VAL)
532 char *errnumber =
pstrdup(num);
534 errnumber[endptr - num] =
'\0';
536 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
537 errmsg(
"\"%s\" is out of range for type double precision",
543 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
544 errmsg(
"invalid input syntax for type %s: \"%s\"",
545 type_name, orig_string)));
547 #ifdef HAVE_BUGGY_SOLARIS_STRTOD
555 if (endptr != num && endptr[-1] ==
'\0')
561 while (*endptr !=
'\0' && isspace((
unsigned char) *endptr))
567 else if (*endptr !=
'\0')
569 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
570 errmsg(
"invalid input syntax for type %s: \"%s\"",
571 type_name, orig_string)));
601 return strcpy(ascii,
"NaN");
606 strcpy(ascii,
"Infinity");
609 strcpy(ascii,
"-Infinity");
807 result = arg1 + arg2;
827 result = arg1 - arg2;
839 result = arg1 * arg2;
841 arg1 == 0 || arg2 == 0);
854 (
errcode(ERRCODE_DIVISION_BY_ZERO),
855 errmsg(
"division by zero")));
857 result = arg1 / arg2;
876 result = arg1 + arg2;
889 result = arg1 - arg2;
902 result = arg1 * arg2;
905 arg1 == 0 || arg2 == 0);
918 (
errcode(ERRCODE_DIVISION_BY_ZERO),
919 errmsg(
"division by zero")));
921 result = arg1 / arg2;
1225 if (num < INT_MIN || num > INT_MAX || isnan(num))
1227 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1228 errmsg(
"integer out of range")));
1243 if (num < SHRT_MIN || num > SHRT_MAX || isnan(num))
1245 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1246 errmsg(
"smallint out of range")));
1284 if (num < INT_MIN || num > INT_MAX || isnan(num))
1286 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1287 errmsg(
"integer out of range")));
1301 if (num < SHRT_MIN || num > SHRT_MAX || isnan(num))
1303 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1304 errmsg(
"smallint out of range")));
1410 result = floor(arg1);
1412 result = -floor(-arg1);
1429 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION),
1430 errmsg(
"cannot take square root of a negative number")));
1432 result = sqrt(arg1);
1448 result =
cbrt(arg1);
1469 if (arg1 == 0 && arg2 < 0)
1471 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION),
1472 errmsg(
"zero raised to a negative power is undefined")));
1473 if (arg1 < 0 && floor(arg2) != arg2)
1475 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION),
1476 errmsg(
"a negative number raised to a non-integer power yields a complex result")));
1488 result = pow(arg1, arg2);
1489 if (errno == EDOM && isnan(result))
1491 if ((fabs(arg1) > 1 && arg2 >= 0) || (fabs(arg1) < 1 && arg2 < 0))
1494 else if (fabs(arg1) != 1)
1499 else if (errno == ERANGE && result != 0 && !
isinf(result))
1518 if (errno == ERANGE && result != 0 && !
isinf(result))
1541 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1542 errmsg(
"cannot take logarithm of zero")));
1545 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1546 errmsg(
"cannot take logarithm of a negative number")));
1571 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1572 errmsg(
"cannot take logarithm of zero")));
1575 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1576 errmsg(
"cannot take logarithm of a negative number")));
1578 result = log10(arg1);
1603 if (arg1 < -1.0 || arg1 > 1.0)
1605 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1606 errmsg(
"input is out of range")));
1608 result = acos(arg1);
1633 if (arg1 < -1.0 || arg1 > 1.0)
1635 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1636 errmsg(
"input is out of range")));
1638 result = asin(arg1);
1663 result = atan(arg1);
1681 if (isnan(arg1) || isnan(arg2))
1688 result = atan2(arg1, arg2);
1725 if (errno != 0 ||
isinf(arg1))
1727 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1728 errmsg(
"input is out of range")));
1751 if (errno != 0 ||
isinf(arg1))
1753 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1754 errmsg(
"input is out of range")));
1756 result = 1.0 / result;
1778 if (errno != 0 ||
isinf(arg1))
1780 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1781 errmsg(
"input is out of range")));
1804 if (errno != 0 ||
isinf(arg1))
1806 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1807 errmsg(
"input is out of range")));
1858 #define INIT_DEGREE_CONSTANTS() \
1860 if (!degree_consts_set) \
1861 init_degree_constants(); \
1885 volatile float8 asin_x = asin(x);
1891 volatile float8 acos_x = acos(x);
1893 return 90.0 - (acos_x /
acos_0_5) * 60.0;
1918 volatile float8 asin_x = asin(x);
1920 return 90.0 - (asin_x /
asin_0_5) * 30.0;
1924 volatile float8 acos_x = acos(x);
1951 if (arg1 < -1.0 || arg1 > 1.0)
1953 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1954 errmsg(
"input is out of range")));
1986 if (arg1 < -1.0 || arg1 > 1.0)
1988 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1989 errmsg(
"input is out of range")));
2009 volatile float8 atan_arg1;
2023 atan_arg1 = atan(arg1);
2024 result = (atan_arg1 /
atan_1_0) * 45.0;
2040 volatile float8 atan2_arg1_arg2;
2043 if (isnan(arg1) || isnan(arg2))
2057 atan2_arg1_arg2 = atan2(arg1, arg2);
2058 result = (atan2_arg1_arg2 /
atan_1_0) * 45.0;
2075 return (sin_x /
sin_30) / 2.0;
2152 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2153 errmsg(
"input is out of range")));
2158 arg1 = fmod(arg1, 360.0);
2169 arg1 = 360.0 - arg1;
2175 arg1 = 180.0 - arg1;
2179 result = sign *
cosd_q1(arg1);
2194 volatile float8 cot_arg1;
2206 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2207 errmsg(
"input is out of range")));
2212 arg1 = fmod(arg1, 360.0);
2224 arg1 = 360.0 - arg1;
2231 arg1 = 180.0 - arg1;
2236 result = sign * (cot_arg1 /
cot_45);
2270 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2271 errmsg(
"input is out of range")));
2276 arg1 = fmod(arg1, 360.0);
2288 arg1 = 360.0 - arg1;
2295 arg1 = 180.0 - arg1;
2298 result = sign *
sind_q1(arg1);
2313 volatile float8 tan_arg1;
2325 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2326 errmsg(
"input is out of range")));
2331 arg1 = fmod(arg1, 360.0);
2343 arg1 = 360.0 - arg1;
2350 arg1 = 180.0 - arg1;
2355 result = sign * (tan_arg1 /
tan_45);
2436 if (seed < -1 || seed > 1)
2437 elog(
ERROR,
"setseed parameter %f out of range [-1,1]", seed);
2440 srandom((
unsigned int) iseed);
2481 elog(
ERROR,
"%s: expected %d-element float8 array", caller, n);
2505 elog(
ERROR,
"aggregate function called in non-aggregate context");
2508 N = transvalues1[0];
2509 sumX = transvalues1[1];
2510 sumX2 = transvalues1[2];
2514 N += transvalues2[0];
2515 sumX += transvalues2[1];
2518 sumX2 += transvalues2[2];
2522 transvalues1[0] = N;
2523 transvalues1[1] = sumX;
2524 transvalues1[2] = sumX2;
2541 sumX = transvalues[1];
2542 sumX2 = transvalues[2];
2547 sumX2 += newval *
newval;
2558 transvalues[1] = sumX;
2559 transvalues[2] = sumX2;
2565 Datum transdatums[3];
2574 sizeof(
float8), FLOAT8PASSBYVAL,
'd');
2594 sumX = transvalues[1];
2595 sumX2 = transvalues[2];
2600 sumX2 += newval *
newval;
2611 transvalues[1] = sumX;
2612 transvalues[2] = sumX2;
2618 Datum transdatums[3];
2627 sizeof(
float8), FLOAT8PASSBYVAL,
'd');
2643 sumX = transvalues[1];
2665 sumX = transvalues[1];
2666 sumX2 = transvalues[2];
2672 numerator = N * sumX2 - sumX * sumX;
2676 if (numerator <= 0.0)
2694 sumX = transvalues[1];
2695 sumX2 = transvalues[2];
2701 numerator = N * sumX2 - sumX * sumX;
2705 if (numerator <= 0.0)
2723 sumX = transvalues[1];
2724 sumX2 = transvalues[2];
2730 numerator = N * sumX2 - sumX * sumX;
2734 if (numerator <= 0.0)
2752 sumX = transvalues[1];
2753 sumX2 = transvalues[2];
2759 numerator = N * sumX2 - sumX * sumX;
2763 if (numerator <= 0.0)
2801 sumX = transvalues[1];
2802 sumX2 = transvalues[2];
2803 sumY = transvalues[3];
2804 sumY2 = transvalues[4];
2805 sumXY = transvalues[5];
2810 sumX2 += newvalX * newvalX;
2814 sumY2 += newvalY * newvalY;
2816 sumXY += newvalX * newvalY;
2818 isinf(newvalY),
true);
2828 transvalues[1] = sumX;
2829 transvalues[2] = sumX2;
2830 transvalues[3] = sumY;
2831 transvalues[4] = sumY2;
2832 transvalues[5] = sumXY;
2838 Datum transdatums[6];
2850 sizeof(
float8), FLOAT8PASSBYVAL,
'd');
2879 elog(
ERROR,
"aggregate function called in non-aggregate context");
2882 N = transvalues1[0];
2883 sumX = transvalues1[1];
2884 sumX2 = transvalues1[2];
2885 sumY = transvalues1[3];
2886 sumY2 = transvalues1[4];
2887 sumXY = transvalues1[5];
2891 N += transvalues2[0];
2892 sumX += transvalues2[1];
2895 sumX2 += transvalues2[2];
2898 sumY += transvalues2[3];
2901 sumY2 += transvalues2[4];
2904 sumXY += transvalues2[5];
2908 transvalues1[0] = N;
2909 transvalues1[1] = sumX;
2910 transvalues1[2] = sumX2;
2911 transvalues1[3] = sumY;
2912 transvalues1[4] = sumY2;
2913 transvalues1[5] = sumXY;
2931 sumX = transvalues[1];
2932 sumX2 = transvalues[2];
2938 numerator = N * sumX2 - sumX * sumX;
2942 if (numerator <= 0.0)
2960 sumY = transvalues[3];
2961 sumY2 = transvalues[4];
2967 numerator = N * sumY2 - sumY * sumY;
2971 if (numerator <= 0.0)
2990 sumX = transvalues[1];
2991 sumY = transvalues[3];
2992 sumXY = transvalues[5];
2998 numerator = N * sumXY - sumX * sumY;
3017 sumX = transvalues[1];
3036 sumY = transvalues[3];
3058 sumX = transvalues[1];
3059 sumY = transvalues[3];
3060 sumXY = transvalues[5];
3066 numerator = N * sumXY - sumX * sumY;
3086 sumX = transvalues[1];
3087 sumY = transvalues[3];
3088 sumXY = transvalues[5];
3094 numerator = N * sumXY - sumX * sumY;
3118 sumX = transvalues[1];
3119 sumX2 = transvalues[2];
3120 sumY = transvalues[3];
3121 sumY2 = transvalues[4];
3122 sumXY = transvalues[5];
3128 numeratorX = N * sumX2 - sumX * sumX;
3130 numeratorY = N * sumY2 - sumY * sumY;
3132 numeratorXY = N * sumXY - sumX * sumY;
3135 if (numeratorX <= 0 || numeratorY <= 0)
3158 sumX = transvalues[1];
3159 sumX2 = transvalues[2];
3160 sumY = transvalues[3];
3161 sumY2 = transvalues[4];
3162 sumXY = transvalues[5];
3168 numeratorX = N * sumX2 - sumX * sumX;
3170 numeratorY = N * sumY2 - sumY * sumY;
3172 numeratorXY = N * sumXY - sumX * sumY;
3175 if (numeratorX <= 0)
3178 if (numeratorY <= 0)
3182 (numeratorX * numeratorY));
3200 sumX = transvalues[1];
3201 sumX2 = transvalues[2];
3202 sumY = transvalues[3];
3203 sumXY = transvalues[5];
3209 numeratorX = N * sumX2 - sumX * sumX;
3211 numeratorXY = N * sumXY - sumX * sumY;
3214 if (numeratorX <= 0)
3235 sumX = transvalues[1];
3236 sumX2 = transvalues[2];
3237 sumY = transvalues[3];
3238 sumXY = transvalues[5];
3244 numeratorX = N * sumX2 - sumX * sumX;
3246 numeratorXXY = sumY * sumX2 - sumX * sumXY;
3249 if (numeratorX <= 0)
3275 result = arg1 + arg2;
3287 result = arg1 - arg2;
3299 result = arg1 * arg2;
3301 arg1 == 0 || arg2 == 0);
3314 (
errcode(ERRCODE_DIVISION_BY_ZERO),
3315 errmsg(
"division by zero")));
3317 result = arg1 / arg2;
3335 result = arg1 + arg2;
3348 result = arg1 - arg2;
3361 result = arg1 * arg2;
3364 arg1 == 0 || arg2 == 0);
3377 (
errcode(ERRCODE_DIVISION_BY_ZERO),
3378 errmsg(
"division by zero")));
3380 result = arg1 / arg2;
3531 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
3532 errmsg(
"count must be greater than zero")));
3534 if (isnan(operand) || isnan(bound1) || isnan(bound2))
3536 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
3537 errmsg(
"operand, lower bound, and upper bound cannot be NaN")));
3542 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
3543 errmsg(
"lower and upper bounds must be finite")));
3545 if (bound1 < bound2)
3547 if (operand < bound1)
3549 else if (operand >= bound2)
3555 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
3556 errmsg(
"integer out of range")));
3559 result = ((
float8) count * (operand - bound1) / (bound2 - bound1)) + 1;
3561 else if (bound1 > bound2)
3563 if (operand > bound1)
3565 else if (operand <= bound2)
3571 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
3572 errmsg(
"integer out of range")));
3575 result = ((
float8) count * (bound1 - operand) / (bound1 - bound2)) + 1;
3580 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
3581 errmsg(
"lower bound cannot equal upper bound")));
3595 int isneg = (x < 0.0);
3596 double absx = fabs(x);
3597 double tmpres = pow(absx, (
double) 1.0 / (
double) 3.0);
3606 tmpres -= (tmpres - absx / (tmpres * tmpres)) / (double) 3.0;
3608 return isneg ? -tmpres : tmpres;
Datum float48lt(PG_FUNCTION_ARGS)
struct SortSupportData * SortSupport
Datum float8ne(PG_FUNCTION_ARGS)
Datum dtoi2(PG_FUNCTION_ARGS)
#define PG_GETARG_FLOAT8(n)
double get_float8_nan(void)
int(* comparator)(Datum x, Datum y, SortSupport ssup)
Datum dlog1(PG_FUNCTION_ARGS)
Datum float4pl(PG_FUNCTION_ARGS)
Datum float4mi(PG_FUNCTION_ARGS)
Datum float84ge(PG_FUNCTION_ARGS)
Datum dcos(PG_FUNCTION_ARGS)
Datum dacos(PG_FUNCTION_ARGS)
#define PG_GETARG_INT32(n)
Datum radians(PG_FUNCTION_ARGS)
Datum float8_stddev_pop(PG_FUNCTION_ARGS)
Datum float4eq(PG_FUNCTION_ARGS)
Datum float8larger(PG_FUNCTION_ARGS)
#define PG_RETURN_FLOAT4(x)
Datum dcosd(PG_FUNCTION_ARGS)
Datum float8_regr_syy(PG_FUNCTION_ARGS)
Datum float4le(PG_FUNCTION_ARGS)
Datum datand(PG_FUNCTION_ARGS)
Datum float48mi(PG_FUNCTION_ARGS)
#define INIT_DEGREE_CONSTANTS()
Datum float4larger(PG_FUNCTION_ARGS)
Datum float8mi(PG_FUNCTION_ARGS)
Datum float8_regr_sxy(PG_FUNCTION_ARGS)
Datum dsin(PG_FUNCTION_ARGS)
Datum float8gt(PG_FUNCTION_ARGS)
Datum dpi(PG_FUNCTION_ARGS)
Datum float48eq(PG_FUNCTION_ARGS)
Datum btfloat8cmp(PG_FUNCTION_ARGS)
char * float8out_internal(double num)
Datum float8in(PG_FUNCTION_ARGS)
static double asind_q1(double x)
Datum float8_var_samp(PG_FUNCTION_ARGS)
static bool degree_consts_set
Datum i4tof(PG_FUNCTION_ARGS)
Datum float4ge(PG_FUNCTION_ARGS)
Datum float8um(PG_FUNCTION_ARGS)
char * pstrdup(const char *in)
Datum ftod(PG_FUNCTION_ARGS)
StringInfoData * StringInfo
#define PG_RETURN_FLOAT8(x)
Datum dpow(PG_FUNCTION_ARGS)
Datum float84div(PG_FUNCTION_ARGS)
float get_float4_nan(void)
static double sind_q1(double x)
Datum float8up(PG_FUNCTION_ARGS)
Datum dtrunc(PG_FUNCTION_ARGS)
#define PG_RETURN_INT32(x)
Datum float8_covar_pop(PG_FUNCTION_ARGS)
Datum float48le(PG_FUNCTION_ARGS)
ArrayType * construct_array(Datum *elems, int nelems, Oid elmtype, int elmlen, bool elmbyval, char elmalign)
Datum ascii(PG_FUNCTION_ARGS)
Datum dceil(PG_FUNCTION_ARGS)
Datum float8eq(PG_FUNCTION_ARGS)
#define PG_RETURN_INT16(x)
int errcode(int sqlerrcode)
Datum btfloat4cmp(PG_FUNCTION_ARGS)
Datum dround(PG_FUNCTION_ARGS)
Datum float8_regr_r2(PG_FUNCTION_ARGS)
int snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3
#define PG_GETARG_POINTER(n)
Datum float84ne(PG_FUNCTION_ARGS)
static void init_degree_constants(void)
Datum float8ge(PG_FUNCTION_ARGS)
#define PG_RETURN_BYTEA_P(x)
Datum float8_regr_sxx(PG_FUNCTION_ARGS)
Datum drandom(PG_FUNCTION_ARGS)
Datum dlog10(PG_FUNCTION_ARGS)
Datum float8_avg(PG_FUNCTION_ARGS)
int float8_cmp_internal(float8 a, float8 b)
int float4_cmp_internal(float4 a, float4 b)
Datum float48pl(PG_FUNCTION_ARGS)
Datum float4_accum(PG_FUNCTION_ARGS)
Datum float8send(PG_FUNCTION_ARGS)
float get_float4_infinity(void)
Datum float4up(PG_FUNCTION_ARGS)
Datum float48ge(PG_FUNCTION_ARGS)
int pg_strncasecmp(const char *s1, const char *s2, size_t n)
#define PG_GETARG_ARRAYTYPE_P(n)
Datum float8_regr_slope(PG_FUNCTION_ARGS)
Datum datan2(PG_FUNCTION_ARGS)
Datum ftoi2(PG_FUNCTION_ARGS)
Datum dtof(PG_FUNCTION_ARGS)
Datum float8pl(PG_FUNCTION_ARGS)
double float8in_internal(char *num, char **endptr_p, const char *type_name, const char *orig_string)
Datum float84pl(PG_FUNCTION_ARGS)
Datum float4div(PG_FUNCTION_ARGS)
static double acosd_q1(double x)
Datum dcbrt(PG_FUNCTION_ARGS)
Datum setseed(PG_FUNCTION_ARGS)
static int btfloat8fastcmp(Datum x, Datum y, SortSupport ssup)
Datum float8abs(PG_FUNCTION_ARGS)
Datum dasin(PG_FUNCTION_ARGS)
#define RADIANS_PER_DEGREE
Datum float8div(PG_FUNCTION_ARGS)
float8 degree_c_forty_five
Datum dtoi4(PG_FUNCTION_ARGS)
Datum float8_regr_combine(PG_FUNCTION_ARGS)
Datum float84mul(PG_FUNCTION_ARGS)
Datum datan(PG_FUNCTION_ARGS)
static double cosd_0_to_60(double x)
Datum float4abs(PG_FUNCTION_ARGS)
Datum ftoi4(PG_FUNCTION_ARGS)
#define PG_RETURN_ARRAYTYPE_P(x)
#define PG_GETARG_FLOAT4(n)
Datum dsind(PG_FUNCTION_ARGS)
#define ereport(elevel, rest)
Datum float8mul(PG_FUNCTION_ARGS)
Datum dfloor(PG_FUNCTION_ARGS)
Datum btfloat48cmp(PG_FUNCTION_ARGS)
Datum float4in(PG_FUNCTION_ARGS)
Datum dsign(PG_FUNCTION_ARGS)
Datum float4mul(PG_FUNCTION_ARGS)
double get_float8_infinity(void)
Datum float8_covar_samp(PG_FUNCTION_ARGS)
Datum float8lt(PG_FUNCTION_ARGS)
Datum float8_regr_intercept(PG_FUNCTION_ARGS)
static float8 one_minus_cos_60
Datum float4recv(PG_FUNCTION_ARGS)
Datum degrees(PG_FUNCTION_ARGS)
Datum float4out(PG_FUNCTION_ARGS)
Datum dcot(PG_FUNCTION_ARGS)
Datum float48ne(PG_FUNCTION_ARGS)
Datum float8recv(PG_FUNCTION_ARGS)
Datum float8_regr_avgx(PG_FUNCTION_ARGS)
static double cosd_q1(double x)
static double sind_0_to_30(double x)
Datum float8_accum(PG_FUNCTION_ARGS)
#define DatumGetFloat8(X)
#define PG_RETURN_BOOL(x)
Datum float4ne(PG_FUNCTION_ARGS)
Datum float4smaller(PG_FUNCTION_ARGS)
Datum dexp(PG_FUNCTION_ARGS)
Datum float84lt(PG_FUNCTION_ARGS)
#define PG_GETARG_INT16(n)
Datum dtand(PG_FUNCTION_ARGS)
Datum float84mi(PG_FUNCTION_ARGS)
Datum width_bucket_float8(PG_FUNCTION_ARGS)
Datum float8_var_pop(PG_FUNCTION_ARGS)
Datum float8_regr_accum(PG_FUNCTION_ARGS)
#define Float8GetDatumFast(X)
Datum btfloat8sortsupport(PG_FUNCTION_ARGS)
#define DatumGetFloat4(X)
#define PG_RETURN_CSTRING(x)
Datum float8smaller(PG_FUNCTION_ARGS)
Datum float4lt(PG_FUNCTION_ARGS)
#define CHECKFLOATVAL(val, inf_is_valid, zero_is_valid)
Datum float84gt(PG_FUNCTION_ARGS)
int AggCheckCallContext(FunctionCallInfo fcinfo, MemoryContext *aggcontext)
Datum i2tof(PG_FUNCTION_ARGS)
Datum float48mul(PG_FUNCTION_ARGS)
Datum dasind(PG_FUNCTION_ARGS)
int is_infinite(double val)
Datum float8_corr(PG_FUNCTION_ARGS)
Datum dsqrt(PG_FUNCTION_ARGS)
Datum datan2d(PG_FUNCTION_ARGS)
Datum i4tod(PG_FUNCTION_ARGS)
Datum float8_combine(PG_FUNCTION_ARGS)
static float8 * check_float8_array(ArrayType *transarray, const char *caller, int n)
Datum float4gt(PG_FUNCTION_ARGS)
Datum btfloat84cmp(PG_FUNCTION_ARGS)
int errmsg(const char *fmt,...)
Datum float8_stddev_samp(PG_FUNCTION_ARGS)
static int btfloat4fastcmp(Datum x, Datum y, SortSupport ssup)
Datum float4send(PG_FUNCTION_ARGS)
Datum float84le(PG_FUNCTION_ARGS)
void srandom(unsigned int seed)
#define PG_GETARG_CSTRING(n)
Datum float8out(PG_FUNCTION_ARGS)
Datum float48div(PG_FUNCTION_ARGS)
Datum dcotd(PG_FUNCTION_ARGS)
Datum float8le(PG_FUNCTION_ARGS)
Datum float8_regr_avgy(PG_FUNCTION_ARGS)
Datum float84eq(PG_FUNCTION_ARGS)
Datum dacosd(PG_FUNCTION_ARGS)
Datum float48gt(PG_FUNCTION_ARGS)
Datum float4um(PG_FUNCTION_ARGS)
Datum i2tod(PG_FUNCTION_ARGS)
Datum dtan(PG_FUNCTION_ARGS)
Datum btfloat4sortsupport(PG_FUNCTION_ARGS)