Why this cython function:
cimport numpy as np
cimport cython
def foo(np.uint32_t b):
cdef np.int32_t a = 0
if a-b <0: return 0
else: return 1
returns 1, for foo(1)? I compiled similar code in C, and didn't observe both operands (a, b) had been promoted to unsigned int.
1
is the correct result; the signed operand should be converted to the corresponding unsigned type.