mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-10 22:56:55 +08:00
Updated comment [skip ci]
This commit is contained in:
@@ -568,7 +568,7 @@ cosine_distance(PG_FUNCTION_ARGS)
|
|||||||
normb += bx[i] * bx[i];
|
normb += bx[i] * bx[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sqrt(a) * sqrt(b) == sqrt(a * b) */
|
/* Use sqrt(a * b) over sqrt(a) * sqrt(b) */
|
||||||
PG_RETURN_FLOAT8(1 - (distance / sqrt(norma * normb)));
|
PG_RETURN_FLOAT8(1 - (distance / sqrt(norma * normb)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user