Commit 2bc8d9cb authored by Robert Bradshaw's avatar Robert Bradshaw

tests for inc/dec and deref

parent e27de484
cimport cython
def test_deref(int x):
"""
>>> test_deref(3)
3
>>> test_deref(5)
5
"""
cdef int* x_ptr = &x
return cython.dereference(x_ptr)
def increment_decrement(int x):
"""
>>> increment_decrement(10)
11 11 12
11 11 10
10
"""
print cython.preincrement(x), cython.postincrement(x), x
print cython.predecrement(x), cython.postdecrement(x), x
return x
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