import math


def is_prime(x: int):
    """
    judge whether x is a prime.
    if x <= 1, then return False.
    :param x: (int)
    :return: (bool) True if x is a prime, while False if not
    """
    if x == 2:
        return True
    if x & 1 == 0 or x <= 1:
        return False
    _is_prime = True
    _sqrt = int(math.sqrt(x)) + 1
    _i = 3
    while _i <= _sqrt:
        if x % _i == 0:
            _is_prime = False
            break
        _i += 2
    return _is_prime