aboutsummaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@online.no>2021-11-27 13:18:58 +0100
committerTor Egge <Tor.Egge@online.no>2021-11-27 13:18:58 +0100
commit7a0ffdc64e8e522035a7bc74ee3cea0bfeb55cd1 (patch)
treeb888c43bfb43255da632230312359b7672f3da78 /eval
parentf9380c5ae3f9e151dc705741cf31145723c2493c (diff)
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);
}