aboutsummaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@verizonmedia.com>2021-11-28 12:23:06 +0100
committerGitHub <noreply@github.com>2021-11-28 12:23:06 +0100
commit434fd1cdb6dee96513779a4a2a6719e9bb4c8b62 (patch)
tree264ec9135299dea12388cec5ae3d37b17682e9a7 /eval
parent1bb93416e22d4509f42d760eb679a9c4f1b59116 (diff)
parent7a0ffdc64e8e522035a7bc74ee3cea0bfeb55cd1 (diff)
Merge pull request #20255 from vespa-engine/toregge/convert-from-double-to-signed-data-type-for-hamming-distance
Convert from double to signed data type for reference hamming distance.
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/eval/hamming_distance.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/eval/src/vespa/eval/eval/hamming_distance.h b/eval/src/vespa/eval/eval/hamming_distance.h
index 50c59c46a60..e7cfc88661d 100644
--- a/eval/src/vespa/eval/eval/hamming_distance.h
+++ b/eval/src/vespa/eval/eval/hamming_distance.h
@@ -5,8 +5,8 @@
namespace vespalib::eval {
inline double hamming_distance(double a, double b) {
- uint8_t x = (uint8_t) a;
- uint8_t y = (uint8_t) b;
+ uint8_t x = (uint8_t) (int8_t) a;
+ uint8_t y = (uint8_t) (int8_t) b;
return __builtin_popcount(x ^ y);
}