64-bit integers in Cython
I'm trying to interface a C++ library (pHash) with Python using Cython, but I have trouble with some of the type开发者_如何学JAVAs. The library functions use "unsigned long long" and I can't find a way to declare variables and parameters with this type. I searched for a list of the types that I can use with cdef but I found nothing. Can anyone point me to such a list (if it exists) or otherwise suggest a way to use 64 bit types in Cython? Thanks.
I've been able to use both unsigned long long
and long long
just fine with cdef. See for instance my answer to this question here. I just tried running the same code there with unsigned long long
instead of long long
and it worked just fine. Can you be more specific about what problems you are having with these types? Maybe you could post some source code that isn't working for you?
Here is one of my answers using unsigned long long
with cython
Simple Python Challenge: Fastest Bitwise XOR on Data Buffers
精彩评论