mirror of
https://github.com/redis/redis.git
synced 2026-05-14 03:01:49 -04:00
HNSW: binary distance: fix type for the xor var.
This commit is contained in:
2
hnsw.c
2
hnsw.c
@@ -295,7 +295,7 @@ float vectors_distance_bin(const uint64_t *x, const uint64_t *y, uint32_t dim) {
|
||||
uint32_t len = (dim+63)/64;
|
||||
uint32_t opposite = 0;
|
||||
for (uint32_t j = 0; j < len; j++) {
|
||||
int64_t xor = x[j]^y[j];
|
||||
uint64_t xor = x[j]^y[j];
|
||||
opposite += popcount64(xor);
|
||||
}
|
||||
return (float)opposite*2/dim;
|
||||
|
||||
Reference in New Issue
Block a user