Cython has moved to github.
cython-devel
view tests/run/int_literals.pyx @ 834:4695bbb3a785
Better integer literal parsing.
Now accepts U and LL suffixes, and large integer literals are longs rather than being truncated as Python objects.
Now accepts U and LL suffixes, and large integer literals are longs rather than being truncated as Python objects.
| author | Robert Bradshaw <robertwb@math.washington.edu> |
|---|---|
| date | Thu Jul 31 00:55:14 2008 -0700 (3 years ago) |
| parents | |
| children | 0310198e281e |
line source
1 __doc__ = """
2 >>> c_longs()
3 (1, 1L, -1L, 18446744073709551615L)
4 >>> py_longs()
5 (1, 1L, 100000000000000000000000000000000L, -100000000000000000000000000000000L)
6 """
8 def c_longs():
9 cdef long a = 1L
10 cdef unsigned long ua = 1UL
11 cdef long long aa = 0xFFFFFFFFFFFFFFFFLL
12 cdef unsigned long long uaa = 0xFFFFFFFFFFFFFFFFULL
14 return a, ua, aa, uaa
16 def py_longs():
17 return 1, 1L, 100000000000000000000000000000000, -100000000000000000000000000000000
