Relative Content

Tag Archive for pythoncython

How to use float128 in cython 3?

Cython version 3.0.10 Python 3.10.12 I have a file sum_array.pyx which is: # sum_array.pyx cimport numpy as np def sum_array(np.ndarray[np.float128_t, ndim=1] arr): cdef int n = arr.shape[0] cdef np.float128_t total = 0 cdef int i for i in range(n): total += arr[i] return total and setup.py which is: # setup.py from setuptools import setup from […]