import math


def is_prime(value: int) -> bool:
    """Detect whether a value is prime or not.

    Args:
        value (int): value.

    Returns:
        bool: Is the value prime.
    """
    if value < 2:
        return False
    if value == 2:
        return True
    if value % 2 == 0:
        return False

    for k in range(3, int(math.sqrt(value)) + 1, 2):
        if value % k == 0:
            return False

    return True