Commit 5b7e7165 authored by Stefan Behnel's avatar Stefan Behnel

extend cfunc_convert test

parent 2baa1889
from libc.math cimport sqrt, log
from libc.math cimport sqrt
cdef void empty_cfunc():
print "here"
......@@ -11,6 +11,7 @@ def call_empty_cfunc():
cdef object py_func = empty_cfunc
py_func()
cdef double square_c(double x):
return x * x
......@@ -24,6 +25,16 @@ def call_square_c(x):
cdef object py_func = square_c
return py_func(x)
def return_libc_sqrt():
"""
>>> sqrt = return_libc_sqrt()
>>> sqrt(9)
3.0
"""
return sqrt
cdef long long rad(long long x):
cdef long long rad = 1
for p in range(2, <long long>sqrt(x) + 1):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment