1# cython: c_string_type=str 2# cython: c_string_encoding=ascii 3# distutils: extra_compile_args=-fpermissive 4 5__doc__ = """ 6>>> sqrt(1) 71.0 8>>> pyx_sqrt(4) 92.0 10>>> pxd_sqrt(9) 113.0 12>>> log(10) # doctest: +ELLIPSIS 13Traceback (most recent call last): 14NameError: ...name 'log' is not defined 15>>> strchr('abcabc', ord('c')) 16'cabc' 17>>> strchr(needle=ord('c'), haystack='abcabc') 18'cabc' 19""" 20 21cdef extern from "math.h": 22 cpdef double sqrt(double) 23 cpdef double pyx_sqrt "sqrt"(double) 24 cdef double log(double) # not wrapped 25 26cdef extern from "string.h": 27 # signature must be exact in C++, disagrees with C 28 cpdef const char* strchr(const char *haystack, int needle); 29