diff --git a/include/poet/DHT_Wrapper.hpp b/include/poet/DHT_Wrapper.hpp index 81fedddc2..a9959e2f5 100644 --- a/include/poet/DHT_Wrapper.hpp +++ b/include/poet/DHT_Wrapper.hpp @@ -36,9 +36,8 @@ extern "C" { namespace poet { using DHT_Keyelement = struct keyelem { - std::uint8_t sign : 1; - std::int8_t exp : 7; - std::uint64_t significant : 56; + std::int8_t exp : 8; + std::int64_t significant : 56; }; /** diff --git a/src/DHT_Wrapper.cpp b/src/DHT_Wrapper.cpp index 26c1a2db3..d053a28fe 100644 --- a/src/DHT_Wrapper.cpp +++ b/src/DHT_Wrapper.cpp @@ -37,10 +37,9 @@ using namespace std; inline DHT_Keyelement round_key_element(double value, std::uint32_t signif) { std::int8_t exp = (std::int8_t)std::floor(std::log10(std::fabs(value))); - std::uint64_t significant = value * std::pow(10, signif - exp); + std::int64_t significant = value * std::pow(10, signif - exp); DHT_Keyelement elem; - elem.sign = value < 0.; elem.exp = exp; elem.significant = significant;