Re: [Boost-users] [boost.multiprecision] export_bits throws on a negative number

Hi John, thanks for stepping in. I would expect that the export just exports the memory representation of the number - maybe with flipped order via msv_first parameter. Especially, something exported via export_bits and than imported via import_bits should be the same, at least on the same platform. That said, I actually was just looking for a way to implement a hash function and thought it was straightforward to use chunks of char. But I could also compute the hash on the str() output. Tassilo

On 28/04/2016 16:40, Tassilo Glander wrote:
Hi John,
thanks for stepping in. I would expect that the export just exports the memory representation of the number - maybe with flipped order via msv_first parameter. Especially, something exported via export_bits and than imported via import_bits should be the same, at least on the same platform. Will fix.
That said, I actually was just looking for a way to implement a hash function and thought it was straightforward to use chunks of char. But I could also compute the hash on the str() output.
You could use str() but it's a rather inefficient way to go, I should probably add specializations for boost::hash and std::hash. John.
participants (2)
-
John Maddock
-
Tassilo Glander