References #3840
git-svn-id: http://svn.osgeo.org/postgis/trunk@15802
b70326c6-7e19-0410-871a-
916f4a2858ee
static void analyze_val(struct geobuf_agg_context *ctx, double val)
{
- if (ceil(val * ctx->e) / ctx->e != val && ctx->e < MAX_PRECISION)
+ if (fabs((round(val * ctx->e) / ctx->e) - val) >= EPSILON &&
+ ctx->e < MAX_PRECISION)
ctx->e *= 10;
}
analyze_val(ctx, pt.y);
if (ctx->dimensions == 3)
analyze_val(ctx, pt.z);
- else if (ctx->dimensions == 4)
+ if (ctx->dimensions == 4)
analyze_val(ctx, pt.m);
}
}