6 #include "cln/number.h"
7 #include "base/cl_macros.h"
11 // For the equal-invariant hashcode, we take a mixture of exponent, length
12 // and the most significant 32 bits. To ensure that equal(x,y) implies
13 // equal_hashcode(x) == equal_hashcode(y) we must make sure that
14 // equal_hashcode(rational(x)) == equal_hashcode(x) and
15 // equal_hashcode(0.0) = 0 (important because of equal(complex(x,0.0),x)).
16 #define equal_hashcode_low(msd,exp,sign) \
17 (((((uint32)(msd) << 7) | ((uint32)(msd) >> 25)) ^ ((sint32)(sign) << 30)) + (uintL)(exp))
18 #define equal_hashcode_one equal_hashcode_low(bit(31),1,0)