30 #include "utils/fmgrprotos.h"
88 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
89 errmsg(
"value out of range: overflow")));
96 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
97 errmsg(
"value out of range: underflow")));
104 (
errcode(ERRCODE_DIVISION_BY_ZERO),
105 errmsg(
"division by zero")));
119 int inf = isinf(
val);
183 const char *type_name,
const char *orig_string,
184 struct Node *escontext)
196 while (*num !=
'\0' && isspace((
unsigned char) *num))
205 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
206 errmsg(
"invalid input syntax for type %s: \"%s\"",
207 type_name, orig_string)));
210 val = strtof(num, &endptr);
213 if (endptr == num || errno != 0)
215 int save_errno = errno;
262 else if (save_errno == ERANGE)
272 #
if !defined(HUGE_VALF)
275 (
val >= HUGE_VALF ||
val <= -HUGE_VALF)
280 char *errnumber =
pstrdup(num);
282 errnumber[endptr - num] =
'\0';
285 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
286 errmsg(
"\"%s\" is out of range for type real",
292 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
293 errmsg(
"invalid input syntax for type %s: \"%s\"",
294 type_name, orig_string)));
298 while (*endptr !=
'\0' && isspace((
unsigned char) *endptr))
304 else if (*endptr !=
'\0')
306 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
307 errmsg(
"invalid input syntax for type %s: \"%s\"",
308 type_name, orig_string)));
395 const char *type_name,
const char *orig_string,
396 struct Node *escontext)
402 while (*num !=
'\0' && isspace((
unsigned char) *num))
411 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
412 errmsg(
"invalid input syntax for type %s: \"%s\"",
413 type_name, orig_string)));
416 val = strtod(num, &endptr);
419 if (endptr == num || errno != 0)
421 int save_errno = errno;
468 else if (save_errno == ERANGE)
481 if (
val == 0.0 ||
val >= HUGE_VAL ||
val <= -HUGE_VAL)
483 char *errnumber =
pstrdup(num);
485 errnumber[endptr - num] =
'\0';
487 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
488 errmsg(
"\"%s\" is out of range for type double precision",
494 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
495 errmsg(
"invalid input syntax for type %s: \"%s\"",
496 type_name, orig_string)));
500 while (*endptr !=
'\0' && isspace((
unsigned char) *endptr))
506 else if (*endptr !=
'\0')
508 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
509 errmsg(
"invalid input syntax for type %s: \"%s\"",
510 type_name, orig_string)));
1039 if (isnan(offset) || offset < 0)
1041 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
1042 errmsg(
"invalid preceding or following size in window function")));
1056 else if (isnan(base))
1074 if (isinf(offset) && isinf(base) &&
1075 (sub ? base > 0 : base < 0))
1085 sum = base - offset;
1087 sum = base + offset;
1115 if (isnan(offset) || offset < 0)
1117 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
1118 errmsg(
"invalid preceding or following size in window function")));
1132 else if (isnan(base))
1150 if (isinf(offset) && isinf(base) &&
1151 (sub ? base > 0 : base < 0))
1161 sum = base - offset;
1163 sum = base + offset;
1200 if (
unlikely(isinf(result)) && !isinf(num))
1202 if (
unlikely(result == 0.0f) && num != 0.0)
1227 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1228 errmsg(
"integer out of range")));
1252 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1253 errmsg(
"smallint out of range")));
1301 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1302 errmsg(
"integer out of range")));
1326 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1327 errmsg(
"smallint out of range")));
1433 result = floor(arg1);
1435 result = -floor(-arg1);
1452 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION),
1453 errmsg(
"cannot take square root of a negative number")));
1455 result = sqrt(arg1);
1456 if (
unlikely(isinf(result)) && !isinf(arg1))
1458 if (
unlikely(result == 0.0) && arg1 != 0.0)
1474 result = cbrt(arg1);
1475 if (
unlikely(isinf(result)) && !isinf(arg1))
1477 if (
unlikely(result == 0.0) && arg1 != 0.0)
1502 if (isnan(arg2) || arg2 != 0.0)
1518 if (arg1 == 0 && arg2 < 0)
1520 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION),
1521 errmsg(
"zero raised to a negative power is undefined")));
1522 if (arg1 < 0 && floor(arg2) != arg2)
1524 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION),
1525 errmsg(
"a negative number raised to a non-integer power yields a complex result")));
1534 float8 absx = fabs(arg1);
1538 else if (arg2 > 0.0)
1553 else if (isinf(arg1))
1557 else if (arg1 > 0.0)
1573 bool yisoddinteger = (floor(halfy) != halfy);
1576 result = yisoddinteger ? arg1 : -arg1;
1578 result = yisoddinteger ? -0.0 : 0.0;
1591 result = pow(arg1, arg2);
1592 if (errno == EDOM || isnan(result))
1609 float8 absx = fabs(arg1);
1613 else if (arg2 >= 0.0 ? (absx > 1.0) : (absx < 1.0))
1619 else if (errno == ERANGE)
1630 if (
unlikely(result == 0.0) && arg1 != 0.0)
1655 else if (isinf(arg1))
1658 result = (arg1 > 0.0) ? arg1 : 0;
1700 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1701 errmsg(
"cannot take logarithm of zero")));
1704 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1705 errmsg(
"cannot take logarithm of a negative number")));
1708 if (
unlikely(isinf(result)) && !isinf(arg1))
1710 if (
unlikely(result == 0.0) && arg1 != 1.0)
1733 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1734 errmsg(
"cannot take logarithm of zero")));
1737 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_LOG),
1738 errmsg(
"cannot take logarithm of a negative number")));
1740 result = log10(arg1);
1741 if (
unlikely(isinf(result)) && !isinf(arg1))
1743 if (
unlikely(result == 0.0) && arg1 != 1.0)
1768 if (arg1 < -1.0 || arg1 > 1.0)
1770 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1771 errmsg(
"input is out of range")));
1773 result = acos(arg1);
1799 if (arg1 < -1.0 || arg1 > 1.0)
1801 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1802 errmsg(
"input is out of range")));
1804 result = asin(arg1);
1830 result = atan(arg1);
1849 if (isnan(arg1) || isnan(arg2))
1856 result = atan2(arg1, arg2);
1894 if (errno != 0 || isinf(arg1))
1896 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1897 errmsg(
"input is out of range")));
1921 if (errno != 0 || isinf(arg1))
1923 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1924 errmsg(
"input is out of range")));
1926 result = 1.0 / result;
1949 if (errno != 0 || isinf(arg1))
1951 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1952 errmsg(
"input is out of range")));
1976 if (errno != 0 || isinf(arg1))
1978 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1979 errmsg(
"input is out of range")));
2030 #define INIT_DEGREE_CONSTANTS() \
2032 if (!degree_consts_set) \
2033 init_degree_constants(); \
2057 volatile float8 asin_x = asin(
x);
2063 volatile float8 acos_x = acos(
x);
2065 return 90.0 - (acos_x /
acos_0_5) * 60.0;
2090 volatile float8 asin_x = asin(
x);
2092 return 90.0 - (asin_x /
asin_0_5) * 30.0;
2096 volatile float8 acos_x = acos(
x);
2123 if (arg1 < -1.0 || arg1 > 1.0)
2125 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2126 errmsg(
"input is out of range")));
2160 if (arg1 < -1.0 || arg1 > 1.0)
2162 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2163 errmsg(
"input is out of range")));
2185 volatile float8 atan_arg1;
2199 atan_arg1 = atan(arg1);
2200 result = (atan_arg1 /
atan_1_0) * 45.0;
2218 volatile float8 atan2_arg1_arg2;
2221 if (isnan(arg1) || isnan(arg2))
2235 atan2_arg1_arg2 = atan2(arg1, arg2);
2236 result = (atan2_arg1_arg2 /
atan_1_0) * 45.0;
2255 return (sin_x /
sin_30) / 2.0;
2332 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2333 errmsg(
"input is out of range")));
2338 arg1 = fmod(arg1, 360.0);
2349 arg1 = 360.0 - arg1;
2355 arg1 = 180.0 - arg1;
2376 volatile float8 cot_arg1;
2388 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2389 errmsg(
"input is out of range")));
2394 arg1 = fmod(arg1, 360.0);
2406 arg1 = 360.0 - arg1;
2413 arg1 = 180.0 - arg1;
2453 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2454 errmsg(
"input is out of range")));
2459 arg1 = fmod(arg1, 360.0);
2471 arg1 = 360.0 - arg1;
2478 arg1 = 180.0 - arg1;
2498 volatile float8 tan_arg1;
2510 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2511 errmsg(
"input is out of range")));
2516 arg1 = fmod(arg1, 360.0);
2528 arg1 = 360.0 - arg1;
2535 arg1 = 180.0 - arg1;
2603 result = sinh(arg1);
2610 if (errno == ERANGE)
2632 result = cosh(arg1);
2638 if (errno == ERANGE)
2659 result = tanh(arg1);
2679 result = asinh(arg1);
2701 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2702 errmsg(
"input is out of range")));
2704 result = acosh(arg1);
2723 if (arg1 < -1.0 || arg1 > 1.0)
2725 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
2726 errmsg(
"input is out of range")));
2735 else if (arg1 == 1.0)
2738 result = atanh(arg1);
2779 result = erfc(arg1);
2851 result = (stddev * z) + mean;
2864 if (seed < -1 || seed > 1 || isnan(seed))
2866 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2867 errmsg(
"setseed parameter %g is out of allowed range [-1,1]",
2938 elog(
ERROR,
"%s: expected %d-element float8 array", caller, n);
2971 N1 = transvalues1[0];
2972 Sx1 = transvalues1[1];
2973 Sxx1 = transvalues1[2];
2975 N2 = transvalues2[0];
2976 Sx2 = transvalues2[1];
2977 Sxx2 = transvalues2[2];
3008 tmp = Sx1 / N1 - Sx2 / N2;
3009 Sxx = Sxx1 + Sxx2 + N1 * N2 * tmp * tmp / N;
3010 if (
unlikely(isinf(Sxx)) && !isinf(Sxx1) && !isinf(Sxx2))
3021 transvalues1[0] = N;
3022 transvalues1[1] = Sx;
3023 transvalues1[2] = Sxx;
3029 Datum transdatums[3];
3057 Sx = transvalues[1];
3058 Sxx = transvalues[2];
3066 if (transvalues[0] > 0.0)
3069 Sxx += tmp * tmp / (N * transvalues[0]);
3077 if (isinf(Sx) || isinf(Sxx))
3079 if (!isinf(transvalues[1]) && !isinf(
newval))
3105 transvalues[1] = Sx;
3106 transvalues[2] = Sxx;
3112 Datum transdatums[3];
3142 Sx = transvalues[1];
3143 Sxx = transvalues[2];
3151 if (transvalues[0] > 0.0)
3154 Sxx += tmp * tmp / (N * transvalues[0]);
3162 if (isinf(Sx) || isinf(Sxx))
3164 if (!isinf(transvalues[1]) && !isinf(
newval))
3190 transvalues[1] = Sx;
3191 transvalues[2] = Sxx;
3197 Datum transdatums[3];
3222 Sx = transvalues[1];
3243 Sxx = transvalues[2];
3265 Sxx = transvalues[2];
3287 Sxx = transvalues[2];
3309 Sxx = transvalues[2];
3360 Sx = transvalues[1];
3361 Sxx = transvalues[2];
3362 Sy = transvalues[3];
3363 Syy = transvalues[4];
3364 Sxy = transvalues[5];
3373 if (transvalues[0] > 0.0)
3375 tmpX = newvalX * N - Sx;
3376 tmpY = newvalY * N - Sy;
3377 scale = 1.0 / (N * transvalues[0]);
3378 Sxx += tmpX * tmpX *
scale;
3379 Syy += tmpY * tmpY *
scale;
3380 Sxy += tmpX * tmpY *
scale;
3388 if (isinf(Sx) || isinf(Sxx) || isinf(Sy) || isinf(Syy) || isinf(Sxy))
3390 if (((isinf(Sx) || isinf(Sxx)) &&
3391 !isinf(transvalues[1]) && !isinf(newvalX)) ||
3392 ((isinf(Sy) || isinf(Syy)) &&
3393 !isinf(transvalues[3]) && !isinf(newvalY)) ||
3395 !isinf(transvalues[1]) && !isinf(newvalX) &&
3396 !isinf(transvalues[3]) && !isinf(newvalY)))
3415 if (isnan(newvalX) || isinf(newvalX))
3417 if (isnan(newvalY) || isinf(newvalY))
3429 transvalues[1] = Sx;
3430 transvalues[2] = Sxx;
3431 transvalues[3] = Sy;
3432 transvalues[4] = Syy;
3433 transvalues[5] = Sxy;
3439 Datum transdatums[6];
3496 N1 = transvalues1[0];
3497 Sx1 = transvalues1[1];
3498 Sxx1 = transvalues1[2];
3499 Sy1 = transvalues1[3];
3500 Syy1 = transvalues1[4];
3501 Sxy1 = transvalues1[5];
3503 N2 = transvalues2[0];
3504 Sx2 = transvalues2[1];
3505 Sxx2 = transvalues2[2];
3506 Sy2 = transvalues2[3];
3507 Syy2 = transvalues2[4];
3508 Sxy2 = transvalues2[5];
3548 tmp1 = Sx1 / N1 - Sx2 / N2;
3549 Sxx = Sxx1 + Sxx2 + N1 * N2 * tmp1 * tmp1 / N;
3550 if (
unlikely(isinf(Sxx)) && !isinf(Sxx1) && !isinf(Sxx2))
3553 tmp2 = Sy1 / N1 - Sy2 / N2;
3554 Syy = Syy1 + Syy2 + N1 * N2 * tmp2 * tmp2 / N;
3555 if (
unlikely(isinf(Syy)) && !isinf(Syy1) && !isinf(Syy2))
3557 Sxy = Sxy1 + Sxy2 + N1 * N2 * tmp1 * tmp2 / N;
3558 if (
unlikely(isinf(Sxy)) && !isinf(Sxy1) && !isinf(Sxy2))
3569 transvalues1[0] = N;
3570 transvalues1[1] = Sx;
3571 transvalues1[2] = Sxx;
3572 transvalues1[3] = Sy;
3573 transvalues1[4] = Syy;
3574 transvalues1[5] = Sxy;
3580 Datum transdatums[6];
3609 Sxx = transvalues[2];
3630 Syy = transvalues[4];
3651 Sxy = transvalues[5];
3672 Sx = transvalues[1];
3691 Sy = transvalues[3];
3710 Sxy = transvalues[5];
3729 Sxy = transvalues[5];
3750 Sxx = transvalues[2];
3751 Syy = transvalues[4];
3752 Sxy = transvalues[5];
3761 if (Sxx == 0 || Syy == 0)
3779 Sxx = transvalues[2];
3780 Syy = transvalues[4];
3781 Sxy = transvalues[5];
3811 Sxx = transvalues[2];
3812 Sxy = transvalues[5];
3840 Sx = transvalues[1];
3841 Sxx = transvalues[2];
3842 Sy = transvalues[3];
3843 Sxy = transvalues[5];
4094 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
4095 errmsg(
"count must be greater than zero")));
4097 if (isnan(operand) || isnan(bound1) || isnan(bound2))
4099 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
4100 errmsg(
"operand, lower bound, and upper bound cannot be NaN")));
4103 if (isinf(bound1) || isinf(bound2))
4105 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
4106 errmsg(
"lower and upper bounds must be finite")));
4108 if (bound1 < bound2)
4110 if (operand < bound1)
4112 else if (operand >= bound2)
4116 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
4117 errmsg(
"integer out of range")));
4121 if (!isinf(bound2 - bound1))
4124 result = count * ((operand - bound1) / (bound2 - bound1));
4137 result = count * ((operand / 2 - bound1 / 2) / (bound2 / 2 - bound1 / 2));
4140 if (result >= count)
4146 else if (bound1 > bound2)
4148 if (operand > bound1)
4150 else if (operand <= bound2)
4154 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
4155 errmsg(
"integer out of range")));
4159 if (!isinf(bound1 - bound2))
4160 result = count * ((bound1 - operand) / (bound1 - bound2));
4162 result = count * ((bound1 / 2 - operand / 2) / (bound1 / 2 - bound2 / 2));
4163 if (result >= count)
4171 (
errcode(ERRCODE_INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION),
4172 errmsg(
"lower bound cannot equal upper bound")));
#define PG_GETARG_ARRAYTYPE_P(n)
#define PG_RETURN_ARRAYTYPE_P(x)
ArrayType * construct_array(Datum *elems, int nelems, Oid elmtype, int elmlen, bool elmbyval, char elmalign)
TimestampTz GetCurrentTimestamp(void)
Datum now(PG_FUNCTION_ARGS)
#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)
elog(ERROR, "%s: %s", p2, msg)
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)
static bool drandom_seed_set
Datum ftoi2(PG_FUNCTION_ARGS)
Datum float4mi(PG_FUNCTION_ARGS)
Datum float8_accum(PG_FUNCTION_ARGS)
static void initialize_drandom_seed(void)
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)
static pg_prng_state drandom_seed
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 setseed(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 drandom(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)
Datum drandom_normal(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)
double pg_prng_double(pg_prng_state *state)
void pg_prng_seed(pg_prng_state *state, uint64 seed)
double pg_prng_double_normal(pg_prng_state *state)
void pg_prng_fseed(pg_prng_state *state, double fseed)
#define pg_prng_strong_seed(state)
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)