mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-06 05:51:21 +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];
|
||||
}
|
||||
|
||||
/* sqrt(a) * sqrt(b) == sqrt(a * b) */
|
||||
/* Use sqrt(a * b) over sqrt(a) * sqrt(b) */
|
||||
PG_RETURN_FLOAT8(1 - (distance / sqrt(norma * normb)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user