在我的64位电脑上,long long
类型有64位。
print(sizeof(long long))
# prints 8
我需要使用128位整数,幸运的是GCC支持这些。我该如何在Cython中使用它们?
以下方法不起作用。编译只包含以下内容的foo.pyx
文件:
cdef __int128_t x = 0
产出。$ cython foo.pyx
Error compiling Cython file:
------------------------------------------------------------
...
cdef __int128_t x = 0
^
------------------------------------------------------------
foo.pyx:2:5: '__int128_t' is not a type identifier
cdef __int128_t x = 0
。它无法编译。 - chtenb