import random


def do_random_test(negexp=3):
    """
    Return :obj:`True` if a random probability is not greater than a threshold,
    otherwise return :obj:`False`.

    :type negexp: :obj:`int` (non-negative)
    :arg negexp: This is the negative exponent that is used to compute a
        probability threshold. Higher values of ``negexp`` make the threshold
        exponentially smaller. A value of 0 naturally makes the threshold equal
        1, in which case the returned value will be :obj:`True`.
    :rtype: :obj:`bool`
    """
    # Compare random probability with threshold 1e-negexp
    return random.random() <= 10**(-1*negexp)