summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/int_big_cmp.py
blob: d7394d3bc8fd765d4675558f3e3d0e0c2db0c044 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# test bignum comparisons

i = 1 << 65
cases = (0, 1, -1, i, -i, i + 1, -(i + 1))

for lhs in cases:
    for rhs in cases:
        print("{} == {} = {}".format(lhs, rhs, lhs == rhs))
        print("{} != {} = {}".format(lhs, rhs, lhs != rhs))
        print("{} < {} = {}".format(lhs, rhs, lhs < rhs))
        print("{} > {} = {}".format(lhs, rhs, lhs > rhs))
        print("{} <= {} = {}".format(lhs, rhs, lhs <= rhs))
        print("{} >= {} = {}".format(lhs, rhs, lhs >= rhs))