mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-10 06:40:57 +08:00
Use INFINITY instead of DBL_MAX for comparisons
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "postgres.h"
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "catalog/index.h"
|
||||
#include "ivfflat.h"
|
||||
@@ -110,7 +110,7 @@ BuildCallback(Relation index, CALLBACK_ITEM_POINTER, Datum *values,
|
||||
{
|
||||
IvfflatBuildState *buildstate = (IvfflatBuildState *) state;
|
||||
double distance;
|
||||
double minDistance = DBL_MAX;
|
||||
double minDistance = INFINITY;
|
||||
int closestCenter = -1;
|
||||
VectorArray centers = buildstate->centers;
|
||||
TupleTableSlot *slot = buildstate->slot;
|
||||
|
||||
Reference in New Issue
Block a user