Convert from double to signed data type for reference hamming distance.
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);
}
