4 ms·
Sounds like how some people use Cython. Snippet from [0], which is unfortunately temporarily down (I got to it through Google Cache[1]): cpdef double integr
by xiongchiamiov 16y ago
Sounds like how some people use Cython.
Snippet from [0], which is unfortunately temporarily down (I got to it through Google Cache[1]):
cpdef double integrate_f(double a, double b, int N):
cdef double dx, s
cdef int i
dx = (b-a)/N
s = 0
for i in range(N):
s += f(a+i*dx)
return s * dx
[0]: http://www.behnel.de/cython200910/talk.html http://www.behnel.de/cython200910/talk.html
[1]: http://webcache.googleusercontent.com/search?q=cache:7NvoUHhaxRkJ:www.behnel.de/cython200910/talk.html&hl=en&strip=1 http://webcache.googleusercontent.com/search?q=cache:7NvoUHh...