Fixed precision on Windows

This commit is contained in:
Andrew Kane
2023-10-16 17:08:19 -07:00
parent 9ed7e63fb7
commit 9514c152bc

View File

@@ -755,7 +755,12 @@ normalize_l2(PG_FUNCTION_ARGS)
Vector *a = PG_GETARG_VECTOR_P(0);
float *ax = a->x;
double norm = 0.0;
#ifdef _MSC_VER
/* Fix precision on Windows */
double normf;
#else
float normf;
#endif
Vector *result;
float *rx;
@@ -767,7 +772,7 @@ normalize_l2(PG_FUNCTION_ARGS)
norm += (double) ax[i] * (double) ax[i];
norm = sqrt(norm);
normf = (float) norm;
normf = norm;
if (normf > 0)
{