I'm trying to cast a big negative value inside a Cython class to an uint64_t type variable. But i keep getting this error:
OverflowError: can't convert negative value to unsigned long
cdef uint64_t temp2 = <uint64_t>(temp - bitReversal(current_pos))
The number i get from temp - bitReversal(current_pos)
is -1152831344652320768 and if i hardcode it it works. For now i build a really ugly hack converting the negative number to the corresponding unsigned one but it is as expected really slow.