Compares BigInt @a against integer type @b. Returns LESS_THAN, 
    EQUAL, or GREATER_THAN.

def compare(a, b):
    """
    Compares BigInt @a against integer type @b. Returns LESS_THAN, 
    EQUAL, or GREATER_THAN.
    """
    assertType(a, BigInt)
    b = coerceBigInt(b)
    if not b:
        return NotImplemented

    return librelic.bn_cmp(byref(a), byref(b))