Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# We can probably get away with only having the mpz_binary_searches in here. # I'm too scared to get rid of it at 2am though. cdef Py_ssize_t binary_search(Py_ssize_t* v, Py_ssize_t n, Py_ssize_t x, Py_ssize_t* ins): """ Find the position of the integer x in the array v, which has length n. Returns -1 if x is not in the array v, and in this case ins is set equal to the position where x should be inserted in order to obtain an ordered array. """
cdef Py_ssize_t i, j, k else: else: # only possibility is that v[k] == x # end while
cdef Py_ssize_t binary_search0(Py_ssize_t* v, Py_ssize_t n, Py_ssize_t x): """ Find the position of the int x in the array v, which has length n. Returns -1 if x is not in the array v. """
cdef Py_ssize_t i, j, k else: # only possibility is that v[k] == x
|