开发者

64-bit integers in Cython

开发者 https://www.devze.com 2023-01-03 05:50 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号