28 #include "utils/fmgrprotos.h"
90 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
91 errmsg(
"value out of range: overflow")));
98 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
99 errmsg(
"value out of range: underflow")));
106 (
errcode(ERRCODE_DIVISION_BY_ZERO),
107 errmsg(
"division by zero")));
121 int inf = isinf(
val);
185 const char *type_name,
const char *orig_string,
186 struct Node *escontext)
198 while (*num !=
'\0' && isspace((
unsigned char) *num))
207 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
208 errmsg(
"invalid input syntax for type %s: \"%s\"",
209 type_name, orig_string)));
212 val = strtof(num, &endptr);
215 if (endptr == num || errno != 0)
217 int save_errno = errno;
264 else if (save_errno == ERANGE)
274 #
if !defined(HUGE_VALF)
277 (
val >= HUGE_VALF ||
val <= -HUGE_VALF)
282 char *errnumber =
pstrdup(num);
284 errnumber[endptr - num] =
'\0';
287 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
288 errmsg(
"\"%s\" is out of range for type real",
294 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
295 errmsg(
"invalid input syntax for type %s: \"%s\"",
296 type_name, orig_string)));
300 while (*endptr !=
'\0' && isspace((
unsigned char) *endptr))
306 else if (*endptr !=
'\0')
308 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
309 errmsg(
"invalid input syntax for type %s: \"%s\"",
310 type_name, orig_string)));
397 const char *type_name,
const char *orig_string,
398 struct Node *escontext)
404 while (*num !=
'\0' && isspace((
unsigned char) *num))
413 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
414 errmsg(
"invalid input syntax for type %s: \"%s\"",
415 type_name, orig_string)));
418 val = strtod(num, &endptr);
421 if (endptr == num || errno != 0)
423 int save_errno = errno;
470 else if (save_errno == ERANGE)
483 if (
val == 0.0 ||
val >= HUGE_VAL ||
val <= -HUGE_VAL)
485 char *errnumber =
pstrdup(num);
487 errnumber[endptr - num] =
'\0';
489 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
490 errmsg(
"\"%s\" is out of range for type double precision",
496 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
497 errmsg(
"invalid input syntax for type %s: \"%s\"",
498 type_name, orig_string)));
502 while (*endptr !=
'\0' && isspace((
unsigned char) *endptr))
508 else if (*endptr !=
'\0')
510 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
511 errmsg(
"invalid input syntax for type %s: \"%s\"",
512 type_name, orig_string)));
1041 if (isnan(offset) || offset < 0)
1043 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
1044 errmsg(
"invalid preceding or following size in window function")));
1058 else if (isnan(base))
1076 if (isinf(offset) && isinf(base) &&
1077 (sub ? base > 0 : base < 0))
1087 sum = base - offset;
1089 sum = base + offset;
1117 if (isnan(offset) || offset < 0)
1119 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
1120 errmsg(
"invalid preceding or following size in window function")));
1134 else if (isnan(base))
1152 if (isinf(offset) && isinf(base) &&
1153 (sub ? base > 0 : base < 0))
1163 sum = base - offset;
1165 sum = base + offset;
1202 if (
unlikely(isinf(result)) && !isinf(num))
1204 if (
unlikely(result == 0.0f) && num != 0.0)
1229 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1230 errmsg(
"integer out of range")));
1254 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1255 errmsg(
"smallint out of range")));
1303 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1304 errmsg(
"integer out of range")));
1328 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1329 errmsg(
"smallint out of range")));
1435 result = floor(arg1);
1437 result = -floor(-arg1);
1454 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION),
1455 errmsg(
"cannot take square root of a negative number")));
1457 result = sqrt(arg1);
1458 if (
unlikely(isinf(result)) && !isinf(arg1))
1460 if (
unlikely(result == 0.0) && arg1 != 0.0)
1476 result = cbrt(arg1);
1477 if (
unlikely(isinf(result)) && !isinf(arg1))
1479 if (
unlikely(result == 0.0) && arg1 != 0.0)
1504 if (isnan(arg2) || arg2 != 0.0)
1520 if (arg1 == 0 && arg2 < 0)
1522 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION),
1523 errmsg(
"zero raised to a negative power is undefined")));
1524 if (arg1 < 0 && floor(arg2) != arg2)
1526 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION),
1527 errmsg(
"a negative number raised to a non-integer power yields a complex result")));
1536 float8 absx = fabs(arg1);
1540 else if (arg2 > 0.0)
1555 else if (isinf(arg1))
1559 else if (arg1 > 0.0)
1575 bool yisoddinteger = (floor(halfy) != halfy);
1578 result = yisoddinteger ? arg1 : -arg1;
1580 result = yisoddinteger ? -0.0 : 0.0;
1593 result = pow(arg1, arg2);
1594 if (errno == EDOM || isnan(result))
1611 float8 absx = fabs(arg1);
1615 else if (arg2 >= 0.0 ? (absx > 1.0) : (absx < 1.0))
1621 else if (errno == ERANGE)
1632 if (
unlikely(result == 0.0) && arg1 != 0.0)
1657 else if (isinf(arg1))
1660 result = (arg1 > 0.0) ? arg1 : 0;
1702 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1703 errmsg(
"cannot take logarithm of zero")));
1706 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1707 errmsg(
"cannot take logarithm of a negative number")));
1710 if (
unlikely(isinf(result)) && !isinf(arg1))
1712 if (
unlikely(result == 0.0) && arg1 != 1.0)
1735 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1736 errmsg(
"cannot take logarithm of zero")));
1739 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1740 errmsg(
"cannot take logarithm of a negative number")));
1742 result = log10(arg1);
1743 if (
unlikely(isinf(result)) && !isinf(arg1))
1745 if (
unlikely(result == 0.0) && arg1 != 1.0)
1770 if (arg1 < -1.0 || arg1 > 1.0)
1772 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1773 errmsg(
"input is out of range")));
1775 result = acos(arg1);
1801 if (arg1 < -1.0 || arg1 > 1.0)
1803 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1804 errmsg(
"input is out of range")));
1806 result = asin(arg1);
1832 result = atan(arg1);
1851 if (isnan(arg1) || isnan(arg2))
1858 result = atan2(arg1, arg2);
1896 if (errno != 0 || isinf(arg1))
1898 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1899 errmsg(
"input is out of range")));
1923 if (errno != 0 || isinf(arg1))
1925 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1926 errmsg(
"input is out of range")));
1928 result = 1.0 / result;
1951 if (errno != 0 || isinf(arg1))
1953 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1954 errmsg(
"input is out of range")));
1978 if (errno != 0 || isinf(arg1))
1980 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1981 errmsg(
"input is out of range")));
2032 #define INIT_DEGREE_CONSTANTS() \
2034 if (!degree_consts_set) \
2035 init_degree_constants(); \
2059 volatile float8 asin_x = asin(
x);
2065 volatile float8 acos_x = acos(
x);
2067 return 90.0 - (acos_x /
acos_0_5) * 60.0;
2092 volatile float8 asin_x = asin(
x);
2094 return 90.0 - (asin_x /
asin_0_5) * 30.0;
2098 volatile float8 acos_x = acos(
x);
2125 if (arg1 < -1.0 || arg1 > 1.0)
2127 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2128 errmsg(
"input is out of range")));
2162 if (arg1 < -1.0 || arg1 > 1.0)
2164 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2165 errmsg(
"input is out of range")));
2187 volatile float8 atan_arg1;
2201 atan_arg1 = atan(arg1);
2202 result = (atan_arg1 /
atan_1_0) * 45.0;
2220 volatile float8 atan2_arg1_arg2;
2223 if (isnan(arg1) || isnan(arg2))
2237 atan2_arg1_arg2 = atan2(arg1, arg2);
2238 result = (atan2_arg1_arg2 /
atan_1_0) * 45.0;
2257 return (sin_x /
sin_30) / 2.0;
2334 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2335 errmsg(
"input is out of range")));
2340 arg1 = fmod(arg1, 360.0);
2351 arg1 = 360.0 - arg1;
2357 arg1 = 180.0 - arg1;
2378 volatile float8 cot_arg1;
2390 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2391 errmsg(
"input is out of range")));
2396 arg1 = fmod(arg1, 360.0);
2408 arg1 = 360.0 - arg1;
2415 arg1 = 180.0 - arg1;
2455 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2456 errmsg(
"input is out of range")));
2461 arg1 = fmod(arg1, 360.0);
2473 arg1 = 360.0 - arg1;
2480 arg1 = 180.0 - arg1;
2500 volatile float8 tan_arg1;
2512 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2513 errmsg(
"input is out of range")));
2518 arg1 = fmod(arg1, 360.0);
2530 arg1 = 360.0 - arg1;
2537 arg1 = 180.0 - arg1;
2605 result = sinh(arg1);
2612 if (errno == ERANGE)
2634 result = cosh(arg1);
2640 if (errno == ERANGE)
2661 result = tanh(arg1);
2681 result = asinh(arg1);
2703 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2704 errmsg(
"input is out of range")));
2706 result = acosh(arg1);
2725 if (arg1 < -1.0 || arg1 > 1.0)
2727 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2728 errmsg(
"input is out of range")));
2737 else if (arg1 == 1.0)
2740 result = atanh(arg1);
2781 result = erfc(arg1);
2851 elog(
ERROR,
"%s: expected %d-element float8 array", caller, n);
2884 N1 = transvalues1[0];
2885 Sx1 = transvalues1[1];
2886 Sxx1 = transvalues1[2];
2888 N2 = transvalues2[0];
2889 Sx2 = transvalues2[1];
2890 Sxx2 = transvalues2[2];
2921 tmp = Sx1 / N1 - Sx2 / N2;
2922 Sxx = Sxx1 + Sxx2 + N1 * N2 * tmp * tmp / N;
2923 if (
unlikely(isinf(Sxx)) && !isinf(Sxx1) && !isinf(Sxx2))
2934 transvalues1[0] = N;
2935 transvalues1[1] = Sx;
2936 transvalues1[2] = Sxx;
2942 Datum transdatums[3];
2968 Sx = transvalues[1];
2969 Sxx = transvalues[2];
2977 if (transvalues[0] > 0.0)
2980 Sxx += tmp * tmp / (N * transvalues[0]);
2988 if (isinf(Sx) || isinf(Sxx))
2990 if (!isinf(transvalues[1]) && !isinf(
newval))
3016 transvalues[1] = Sx;
3017 transvalues[2] = Sxx;
3023 Datum transdatums[3];
3051 Sx = transvalues[1];
3052 Sxx = transvalues[2];
3060 if (transvalues[0] > 0.0)
3063 Sxx += tmp * tmp / (N * transvalues[0]);
3071 if (isinf(Sx) || isinf(Sxx))
3073 if (!isinf(transvalues[1]) && !isinf(
newval))
3099 transvalues[1] = Sx;
3100 transvalues[2] = Sxx;
3106 Datum transdatums[3];
3129 Sx = transvalues[1];
3150 Sxx = transvalues[2];
3172 Sxx = transvalues[2];
3194 Sxx = transvalues[2];
3216 Sxx = transvalues[2];
3267 Sx = transvalues[1];
3268 Sxx = transvalues[2];
3269 Sy = transvalues[3];
3270 Syy = transvalues[4];
3271 Sxy = transvalues[5];
3280 if (transvalues[0] > 0.0)
3282 tmpX = newvalX * N - Sx;
3283 tmpY = newvalY * N - Sy;
3284 scale = 1.0 / (N * transvalues[0]);
3285 Sxx += tmpX * tmpX *
scale;
3286 Syy += tmpY * tmpY *
scale;
3287 Sxy += tmpX * tmpY *
scale;
3295 if (isinf(Sx) || isinf(Sxx) || isinf(Sy) || isinf(Syy) || isinf(Sxy))
3297 if (((isinf(Sx) || isinf(Sxx)) &&
3298 !isinf(transvalues[1]) && !isinf(newvalX)) ||
3299 ((isinf(Sy) || isinf(Syy)) &&
3300 !isinf(transvalues[3]) && !isinf(newvalY)) ||
3302 !isinf(transvalues[1]) && !isinf(newvalX) &&
3303 !isinf(transvalues[3]) && !isinf(newvalY)))
3322 if (isnan(newvalX) || isinf(newvalX))
3324 if (isnan(newvalY) || isinf(newvalY))
3336 transvalues[1] = Sx;
3337 transvalues[2] = Sxx;
3338 transvalues[3] = Sy;
3339 transvalues[4] = Syy;
3340 transvalues[5] = Sxy;
3346 Datum transdatums[6];
3401 N1 = transvalues1[0];
3402 Sx1 = transvalues1[1];
3403 Sxx1 = transvalues1[2];
3404 Sy1 = transvalues1[3];
3405 Syy1 = transvalues1[4];
3406 Sxy1 = transvalues1[5];
3408 N2 = transvalues2[0];
3409 Sx2 = transvalues2[1];
3410 Sxx2 = transvalues2[2];
3411 Sy2 = transvalues2[3];
3412 Syy2 = transvalues2[4];
3413 Sxy2 = transvalues2[5];
3453 tmp1 = Sx1 / N1 - Sx2 / N2;
3454 Sxx = Sxx1 + Sxx2 + N1 * N2 * tmp1 * tmp1 / N;
3455 if (
unlikely(isinf(Sxx)) && !isinf(Sxx1) && !isinf(Sxx2))
3458 tmp2 = Sy1 / N1 - Sy2 / N2;
3459 Syy = Syy1 + Syy2 + N1 * N2 * tmp2 * tmp2 / N;
3460 if (
unlikely(isinf(Syy)) && !isinf(Syy1) && !isinf(Syy2))
3462 Sxy = Sxy1 + Sxy2 + N1 * N2 * tmp1 * tmp2 / N;
3463 if (
unlikely(isinf(Sxy)) && !isinf(Sxy1) && !isinf(Sxy2))
3474 transvalues1[0] = N;
3475 transvalues1[1] = Sx;
3476 transvalues1[2] = Sxx;
3477 transvalues1[3] = Sy;
3478 transvalues1[4] = Syy;
3479 transvalues1[5] = Sxy;
3485 Datum transdatums[6];
3512 Sxx = transvalues[2];
3533 Syy = transvalues[4];
3554 Sxy = transvalues[5];
3575 Sx = transvalues[1];
3594 Sy = transvalues[3];
3613 Sxy = transvalues[5];
3632 Sxy = transvalues[5];
3653 Sxx = transvalues[2];
3654 Syy = transvalues[4];
3655 Sxy = transvalues[5];
3664 if (Sxx == 0 || Syy == 0)
3682 Sxx = transvalues[2];
3683 Syy = transvalues[4];
3684 Sxy = transvalues[5];
3714 Sxx = transvalues[2];
3715 Sxy = transvalues[5];
3743 Sx = transvalues[1];
3744 Sxx = transvalues[2];
3745 Sy = transvalues[3];
3746 Sxy = transvalues[5];
3997 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
3998 errmsg(
"count must be greater than zero")));
4000 if (isnan(operand) || isnan(bound1) || isnan(bound2))
4002 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
4003 errmsg(
"operand, lower bound, and upper bound cannot be NaN")));
4006 if (isinf(bound1) || isinf(bound2))
4008 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
4009 errmsg(
"lower and upper bounds must be finite")));
4011 if (bound1 < bound2)
4013 if (operand < bound1)
4015 else if (operand >= bound2)
4019 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
4020 errmsg(
"integer out of range")));
4024 if (!isinf(bound2 - bound1))
4027 result = count * ((operand - bound1) / (bound2 - bound1));
4040 result = count * ((operand / 2 - bound1 / 2) / (bound2 / 2 - bound1 / 2));
4043 if (result >= count)
4049 else if (bound1 > bound2)
4051 if (operand > bound1)
4053 else if (operand <= bound2)
4057 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
4058 errmsg(
"integer out of range")));
4062 if (!isinf(bound1 - bound2))
4063 result = count * ((bound1 - operand) / (bound1 - bound2));
4065 result = count * ((bound1 / 2 - operand / 2) / (bound1 / 2 - bound2 / 2));
4066 if (result >= count)
4074 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
4075 errmsg(
"lower bound cannot equal upper bound")));
#define PG_GETARG_ARRAYTYPE_P(n)
#define PG_RETURN_ARRAYTYPE_P(x)
ArrayType * construct_array_builtin(Datum *elems, int nelems, Oid elmtype)
#define FLOAT4_FITS_IN_INT32(num)
#define FLOAT8_FITS_IN_INT32(num)
#define FLOAT4_FITS_IN_INT16(num)
#define FLOAT8_FITS_IN_INT16(num)
int double_to_shortest_decimal_buf(double f, char *result)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereturn(context, dummy_value,...)
#define ereport(elevel,...)
int float_to_shortest_decimal_buf(float f, char *result)
float8 float8in_internal(char *num, char **endptr_p, const char *type_name, const char *orig_string, struct Node *escontext)
Datum float4lt(PG_FUNCTION_ARGS)
Datum dceil(PG_FUNCTION_ARGS)
Datum btfloat4cmp(PG_FUNCTION_ARGS)
static float8 * check_float8_array(ArrayType *transarray, const char *caller, int n)
Datum float84gt(PG_FUNCTION_ARGS)
Datum dasinh(PG_FUNCTION_ARGS)
Datum float84mi(PG_FUNCTION_ARGS)
static double sind_0_to_30(double x)
Datum dtof(PG_FUNCTION_ARGS)
Datum radians(PG_FUNCTION_ARGS)
pg_noinline void float_zero_divide_error(void)
pg_noinline void float_overflow_error(void)
Datum width_bucket_float8(PG_FUNCTION_ARGS)
Datum dasind(PG_FUNCTION_ARGS)
Datum float8_var_samp(PG_FUNCTION_ARGS)
Datum btfloat84cmp(PG_FUNCTION_ARGS)
Datum ftoi4(PG_FUNCTION_ARGS)
Datum dsind(PG_FUNCTION_ARGS)
Datum datan2(PG_FUNCTION_ARGS)
Datum derfc(PG_FUNCTION_ARGS)
Datum float8div(PG_FUNCTION_ARGS)
Datum float8_regr_syy(PG_FUNCTION_ARGS)
Datum float48gt(PG_FUNCTION_ARGS)
Datum degrees(PG_FUNCTION_ARGS)
Datum btfloat4sortsupport(PG_FUNCTION_ARGS)
Datum dacosd(PG_FUNCTION_ARGS)
static double acosd_q1(double x)
Datum float8_regr_r2(PG_FUNCTION_ARGS)
Datum float8_regr_combine(PG_FUNCTION_ARGS)
Datum float8_regr_slope(PG_FUNCTION_ARGS)
Datum float8eq(PG_FUNCTION_ARGS)
Datum dtanh(PG_FUNCTION_ARGS)
static double cosd_q1(double x)
Datum dlog10(PG_FUNCTION_ARGS)
Datum float84mul(PG_FUNCTION_ARGS)
static bool degree_consts_set
Datum datanh(PG_FUNCTION_ARGS)
Datum dcosd(PG_FUNCTION_ARGS)
static int btfloat8fastcmp(Datum x, Datum y, SortSupport ssup)
Datum derf(PG_FUNCTION_ARGS)
Datum float4up(PG_FUNCTION_ARGS)
Datum float48pl(PG_FUNCTION_ARGS)
Datum dsinh(PG_FUNCTION_ARGS)
Datum float8_combine(PG_FUNCTION_ARGS)
Datum float8_avg(PG_FUNCTION_ARGS)
Datum float8_covar_pop(PG_FUNCTION_ARGS)
Datum dtan(PG_FUNCTION_ARGS)
Datum float8ge(PG_FUNCTION_ARGS)
Datum float8_stddev_pop(PG_FUNCTION_ARGS)
static double asind_q1(double x)
Datum dround(PG_FUNCTION_ARGS)
Datum float4um(PG_FUNCTION_ARGS)
Datum dlog1(PG_FUNCTION_ARGS)
Datum datan2d(PG_FUNCTION_ARGS)
Datum float4abs(PG_FUNCTION_ARGS)
Datum ftod(PG_FUNCTION_ARGS)
Datum float4mul(PG_FUNCTION_ARGS)
Datum float4le(PG_FUNCTION_ARGS)
Datum dcos(PG_FUNCTION_ARGS)
Datum float8_regr_intercept(PG_FUNCTION_ARGS)
Datum float8out(PG_FUNCTION_ARGS)
Datum float84le(PG_FUNCTION_ARGS)
Datum dexp(PG_FUNCTION_ARGS)
Datum float8pl(PG_FUNCTION_ARGS)
Datum float8lt(PG_FUNCTION_ARGS)
Datum float4gt(PG_FUNCTION_ARGS)
Datum float4out(PG_FUNCTION_ARGS)
#define INIT_DEGREE_CONSTANTS()
Datum dsign(PG_FUNCTION_ARGS)
Datum float8recv(PG_FUNCTION_ARGS)
Datum float4send(PG_FUNCTION_ARGS)
Datum float4ne(PG_FUNCTION_ARGS)
Datum float84eq(PG_FUNCTION_ARGS)
Datum float84lt(PG_FUNCTION_ARGS)
Datum float48mi(PG_FUNCTION_ARGS)
Datum float8le(PG_FUNCTION_ARGS)
Datum dtrunc(PG_FUNCTION_ARGS)
Datum btfloat8cmp(PG_FUNCTION_ARGS)
Datum float8in(PG_FUNCTION_ARGS)
Datum float8ne(PG_FUNCTION_ARGS)
Datum dpow(PG_FUNCTION_ARGS)
Datum float8mi(PG_FUNCTION_ARGS)
static double sind_q1(double x)
Datum ftoi2(PG_FUNCTION_ARGS)
Datum float4mi(PG_FUNCTION_ARGS)
Datum float8_accum(PG_FUNCTION_ARGS)
Datum float48eq(PG_FUNCTION_ARGS)
Datum i2tof(PG_FUNCTION_ARGS)
static float8 one_minus_cos_60
Datum float84pl(PG_FUNCTION_ARGS)
Datum btfloat48cmp(PG_FUNCTION_ARGS)
Datum float48ge(PG_FUNCTION_ARGS)
Datum float84div(PG_FUNCTION_ARGS)
Datum dcotd(PG_FUNCTION_ARGS)
pg_noinline void float_underflow_error(void)
Datum float8smaller(PG_FUNCTION_ARGS)
float8 degree_c_forty_five
Datum dsqrt(PG_FUNCTION_ARGS)
Datum float84ge(PG_FUNCTION_ARGS)
Datum float8_stddev_samp(PG_FUNCTION_ARGS)
Datum datand(PG_FUNCTION_ARGS)
Datum float8larger(PG_FUNCTION_ARGS)
Datum dcbrt(PG_FUNCTION_ARGS)
Datum float4in(PG_FUNCTION_ARGS)
static int btfloat4fastcmp(Datum x, Datum y, SortSupport ssup)
Datum float8_regr_sxy(PG_FUNCTION_ARGS)
Datum float8_var_pop(PG_FUNCTION_ARGS)
Datum float48div(PG_FUNCTION_ARGS)
Datum float84ne(PG_FUNCTION_ARGS)
Datum float4_accum(PG_FUNCTION_ARGS)
Datum float8up(PG_FUNCTION_ARGS)
int float4_cmp_internal(float4 a, float4 b)
Datum float48le(PG_FUNCTION_ARGS)
Datum float8_regr_sxx(PG_FUNCTION_ARGS)
Datum float8_corr(PG_FUNCTION_ARGS)
Datum float4recv(PG_FUNCTION_ARGS)
Datum in_range_float8_float8(PG_FUNCTION_ARGS)
Datum float48ne(PG_FUNCTION_ARGS)
Datum dpi(PG_FUNCTION_ARGS)
float4 float4in_internal(char *num, char **endptr_p, const char *type_name, const char *orig_string, struct Node *escontext)
Datum dacos(PG_FUNCTION_ARGS)
Datum float48lt(PG_FUNCTION_ARGS)
static void init_degree_constants(void)
Datum float8mul(PG_FUNCTION_ARGS)
Datum float4div(PG_FUNCTION_ARGS)
Datum in_range_float4_float8(PG_FUNCTION_ARGS)
Datum dtand(PG_FUNCTION_ARGS)
Datum float8abs(PG_FUNCTION_ARGS)
Datum i4tod(PG_FUNCTION_ARGS)
int is_infinite(double val)
Datum i2tod(PG_FUNCTION_ARGS)
Datum dfloor(PG_FUNCTION_ARGS)
Datum btfloat8sortsupport(PG_FUNCTION_ARGS)
Datum dcosh(PG_FUNCTION_ARGS)
char * float8out_internal(double num)
Datum dacosh(PG_FUNCTION_ARGS)
Datum float4ge(PG_FUNCTION_ARGS)
Datum dasin(PG_FUNCTION_ARGS)
Datum i4tof(PG_FUNCTION_ARGS)
Datum datan(PG_FUNCTION_ARGS)
Datum float8gt(PG_FUNCTION_ARGS)
Datum float8_regr_avgx(PG_FUNCTION_ARGS)
Datum float8um(PG_FUNCTION_ARGS)
Datum float8_regr_avgy(PG_FUNCTION_ARGS)
Datum dcot(PG_FUNCTION_ARGS)
Datum dsin(PG_FUNCTION_ARGS)
Datum dtoi4(PG_FUNCTION_ARGS)
Datum float4pl(PG_FUNCTION_ARGS)
Datum float8_covar_samp(PG_FUNCTION_ARGS)
Datum float8send(PG_FUNCTION_ARGS)
Datum float4larger(PG_FUNCTION_ARGS)
Datum dtoi2(PG_FUNCTION_ARGS)
static double cosd_0_to_60(double x)
Datum float48mul(PG_FUNCTION_ARGS)
Datum float4smaller(PG_FUNCTION_ARGS)
Datum float8_regr_accum(PG_FUNCTION_ARGS)
int float8_cmp_internal(float8 a, float8 b)
Datum float4eq(PG_FUNCTION_ARGS)
static float8 float8_mul(const float8 val1, const float8 val2)
static float4 float4_div(const float4 val1, const float4 val2)
#define RADIANS_PER_DEGREE
static float4 get_float4_infinity(void)
static bool float4_lt(const float4 val1, const float4 val2)
static float8 float8_pl(const float8 val1, const float8 val2)
static float8 float8_mi(const float8 val1, const float8 val2)
static bool float4_ge(const float4 val1, const float4 val2)
static float4 get_float4_nan(void)
static bool float8_ne(const float8 val1, const float8 val2)
static bool float4_ne(const float4 val1, const float4 val2)
static float4 float4_pl(const float4 val1, const float4 val2)
static bool float4_eq(const float4 val1, const float4 val2)
static float4 float4_mul(const float4 val1, const float4 val2)
static float8 get_float8_infinity(void)
static bool float8_ge(const float8 val1, const float8 val2)
static float4 float4_mi(const float4 val1, const float4 val2)
static bool float8_le(const float8 val1, const float8 val2)
static bool float4_gt(const float4 val1, const float4 val2)
static bool float8_eq(const float8 val1, const float8 val2)
static bool float4_le(const float4 val1, const float4 val2)
static float8 get_float8_nan(void)
static float8 float8_div(const float8 val1, const float8 val2)
static bool float8_lt(const float8 val1, const float8 val2)
static bool float8_gt(const float8 val1, const float8 val2)
#define PG_RETURN_BYTEA_P(x)
#define PG_GETARG_FLOAT8(n)
#define PG_RETURN_FLOAT8(x)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_CSTRING(x)
#define PG_GETARG_CSTRING(n)
#define PG_RETURN_INT16(x)
#define PG_RETURN_INT32(x)
#define PG_GETARG_INT32(n)
#define PG_GETARG_BOOL(n)
#define PG_GETARG_FLOAT4(n)
#define PG_RETURN_FLOAT4(x)
#define PG_RETURN_BOOL(x)
#define PG_GETARG_INT16(n)
static bool pg_add_s32_overflow(int32 a, int32 b, int32 *result)
char * pstrdup(const char *in)
int AggCheckCallContext(FunctionCallInfo fcinfo, MemoryContext *aggcontext)
Datum ascii(PG_FUNCTION_ARGS)
int pg_strfromd(char *str, size_t count, int precision, double value)
int pg_strncasecmp(const char *s1, const char *s2, size_t n)
static float4 DatumGetFloat4(Datum X)
#define Float8GetDatumFast(X)
static float8 DatumGetFloat8(Datum X)
struct SortSupportData * SortSupport
StringInfoData * StringInfo
int(* comparator)(Datum x, Datum y, SortSupport ssup)