def _is_safe_size(n):
    """
    Is the size of FFT such that FFTPACK can handle it in single precision
    with sufficient accuracy?

    Composite numbers of 2, 3, and 5 are accepted, as FFTPACK has those
    """
    n = int(n)
    if n == 0:
        return True
    for c in (3, 5):
        while n % c == 0:
            n //= c
    return not n & n - 1
